https://www.baeldung.com/java-decorator-pattern
With regards I am trying to understand better the above, anddecorator pattern. I have read an article with an example implementation in java and of course, GoF book I have a curiousity.
Do I always need an abstract parent i.e.for the decorator?
For instance, in the example I have an abstract ChistmasTree
and its implementation, and an abstract TreeDecorator
inheriting from ?ChrimasTree
. The TreeDecorator
has an abstract decorator()
method. Let's assume I have a totally unique override of decorate()
for each and every decorator implementation. Which means : TreeTopper
, Tinsel
, Garland
, and BubbleLights
, simple needs to implement ChristmasTree
. Why create an additional compilation unit under thethese circumstances?