3 ms·
> It's not only that an actual Decorator should not introduce new methods Maybe I'm misreading you, but I've never seen a definition of the Decorator pattern t
by arthurlewis 1y ago
> It's not only that an actual Decorator should not introduce new methods
Maybe I'm misreading you, but I've never seen a definition of the Decorator pattern that doesn't involve new methods on the Decorator. If that's what you mean, can you say more? If not, what do you mean?
- arthurlewis 1y agoOH WAIT I SEE IT I'M THINKING OF THE FACADE PATTERN. Yes, the Ruby community does tend to conflate Decorator, Facade, and Presenter in very confusing ways.
- Fire-Dragon-DoL 1y agoI mean, the ruby community thinks of draper when they talk about Ruby's decorators, so they have a unified definition, even if it conflicts with the definition outside of ruby world
- berkes 1y agoFWIW: I was referring to this: > Note that decorators and the original class object share a common set of features. In the previous diagram, the operation() method was available in both the decorated and undecorated versions. and > GoF Book, "Design Patterns: Elements of Reusable Object-Oriented Software", p.166: > "A decorator object conforms to the interface of the component it decorates so that its presence is transparent to clients."