3 ms·
Couldn’t get this idea out of my mind so I went back to the GoF text: > Decorator subclasses are free to add operations for specific functionality. For example
by arthurlewis 1y ago
Couldn’t get this idea out of my mind so I went back to the GoF text:
> Decorator subclasses are free to add operations for specific functionality. For example, ScrollDecorator’s ScrollTo operation lets other objects scroll the interface if they know there happens to be a ScrollDecorator object in the interface.
- berkes 1y agobut also the next sentence: > ...The important aspect of this pattern is that it lets decorators appear anywhere a VisualComponent can. That way clients generally can't tell the difference between a decorated component and an undecorated one, and so they don't depend at all on the decoration. and further on: > The decorator conforms to the interface of the component it decorates so that its presence is transparent to the component's clients.