3 ms·
> The 'patterns' only make sense in Java because the language itself is so limited. I will always remember the first pattern I learned -- the Decorator Pattern
by masfoobar 2y ago
> The 'patterns' only make sense in Java because the language itself is so limited.
I will always remember the first pattern I learned -- the Decorator Pattern.
From memory, the example used was making hot beverage.. adding milk, sugar, etc. I looked at the code and said "So its a Link List of items?"
I understand the book was covering things in a simple manner but even this looked like bloat, with things like Milk, Sugar, etc.. being its own class (inheriting the decorator) that, in the end, is simply a enum with a couple of structs if using a language like C.
I just felt it we are adding +30 lines of code for this SIMPLE example -- how much bloat would it be for real world solutions?