Stream interfaces

Dave Harris brangdon at cix.co.uk
Thu Mar 1 05:16:00 EST 2001


tgagne at ix.netcom.com (Thomas Gagne) wrote (abridged):
>                 ExternalStream
>                     BufferedExternalStream
>                         ExternalReadStream
>                             ExternalReadWriteStream
>                         ExternalWriteStream
>                 InternalStream
>                     WriteStream
>                         ReadWriteStream

Do you agree this hierarchy is a bit duff? Notice how "Write" appears in 
3 leaf classes: ExternalReadWriteStream, ExternalWriteStream, 
ReadWriteStream. These apparently share no implementation or interface. 
Notice also that in one place we get a trio of classes:

>                         ExternalReadStream
>                             ExternalReadWriteStream
>                         ExternalWriteStream

and in another we get a pair:

>                     WriteStream
>                         ReadWriteStream

yet they would seem to be doing the same kind of thing. How do I get an 
internal stream which is readable but not writable? If ReadWriteStream 
inherits from WriteStream, why doesn't ExternalReadWriteStream inherit 
from ExternalWriteStream?

Something has gone wrong here.

  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