jeudi 25 mai 2017

Are the decorator streams also implemented as adapters of stream instances or as some other design pattern?

From C# in Nutshell: enter image description here

The stream adapters are implemented as adapters of stream instances.

Are the decorator streams also implemented as adapters of stream instances? What design pattern are they implemented?

Note that decorator streams are implemented as derived classes of System.Stream or of its derived classes, while stream adapters are not (but via composition which I guess). So I wonder if adapter patterns can be implemented via either composition or inheritance?

Thanks.

Aucun commentaire:

Enregistrer un commentaire