Stream interfaces
Dave Harris
brangdon at cix.co.uk
Thu Mar 1 15:03:00 EST 2001
tgagne at ix.netcom.com (Thomas Gagne) wrote (abridged):
> Your correct. People are confusing inheritence and usefulness. I
> don't have enough spare cycles to worry about a class'
> inheritence unless I've discovered missing functionality. Since
> I haven't, I haven't.
Well, I have. In the streams hierarchy, too. Albeit not that vendor and
in a beta product so I probably shouldn't say too much about it, but the
hierarchy was very similar. The problem was analogous to methods added to
WriteStream not magically appearing in ExternalWriteStream.
The vendor's fix was to cut&paste methods from one class to the other.
But this is just sticking plaster. The class hierarchy is deeply wrong,
violates "once and only once" all over the place and needs refactoring.
It's not about missing functionality so much as how we can add new kinds
of stream without more error-prone cut&paste.
Whether this can be fixed without breaking existing clients, or fixed at
all without multiple inheritance, I don't know because I've not tried it.
I hope it can be and the problem is not with Smalltalk generally but just
this particular bit of library design. But for whatever reason, this bit
of library design is not ideal.
Dave Harris, Nottingham, UK | "Weave a circle round him thrice,
brangdon at cix.co.uk | And close your eyes with holy dread,
| For he on honey dew hath fed
http://www.bhresearch.co.uk/ | And drunk the milk of Paradise."
More information about the Python-list
mailing list