[Cuis-dev] Stream hierarchy
Weslleymberg Lisboa
weslleym.lisboa at gmail.com
Tue Mar 18 05:16:03 PDT 2025
Hi,
One thing that bugs me a lot is how the Stream hierarchy is defined. Why is ReadWriteStream a subclass of WriteStream where all the methods for reading have to be reimplemented and duplicated from ReadStream?
I've read the corresponding chapter in the Blue Book but it just describes the classes, doesn't explain why it's done this way.
The way I see it, it makes more sense that ReadStream and WriteStream be more specialized Streams which subclass ReadWriteStream and overrides the unneeded methods to raise SholdNotImplement. Like this:
Stream
PositionableStream
ReadWriteStream
ReadStream
WriteStream
What am I missing?
I'm not proposing a change or anything like that. It's just that the curiosity to understand this is killing me :)
--
Att.
Wéslleymberg Lisboa
Graduado em Sistemas de Informação
Docente no IFFluminense - Campus Itaboraí
Ex-Bolsista de IC do Núcleo de Computação Científica (NC2-IFF) - Projeto IFF Aerospace
Github: https://github.com/weslleymberg
Tel.: +55 22 99931-2376
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250318/f803f186/attachment.htm>
More information about the Cuis-dev
mailing list