[Cuis-dev] Stream hierarchy
Gerald Klix
cuis.01 at klix.ch
Tue Mar 18 05:46:06 PDT 2025
We neither have traits nor multiple inheritance.
I often missed it. Clearly I reasonable inheritance hierarchy
would inherit ReadStream and WriteStream from PositionableStream
and ReadWriteStream from both.
Just my 0.02 CHF,
Gerald
On 3/18/25 1:16 PM, Weslleymberg Lisboa via Cuis-dev wrote:
> 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
>
More information about the Cuis-dev
mailing list