Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
arthurlewis
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
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
2.
▲
by
arthurlewis
1y ago
Well, until you need different `colour_coded_availability` methods for different contexts. Helpers get a lot done, but there are absolutely use cases for a separate presentation layer.
3.
▲
by
arthurlewis
1y ago
OH 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.
4.
▲
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&