According to Wiki https://en.wikipedia.org/wiki/Decorator_pattern#Usage
A decorator makes it possible to add or alter behavior of an interface at run-time. Alternatively, the adapter can be used when the wrapper must respect a particular interface and must support polymorphic behavior, and the Facade when an easier or simpler interface to an underlying object is desired.
I'm not getting it about polymorphic behavior
. Where's polymorphic happened in Adaptor, isn't adaptor just transform one interface into another interface ?
Aucun commentaire:
Enregistrer un commentaire