3 ms·
In essense a decorator /is/ a function. Objects (OO) make this more complicated by wrapping objects inside objects. In functional programming you still use con
by bjpbakker 9y ago
In essense a decorator /is/ a function. Objects (OO) make this more complicated by wrapping objects inside objects.
In functional programming you still use concepts like decorators, adapters, strategy. But they’re more natural to use and don’t require lots of explanation like with objects.
In modern Java your decorators can simply be a Function type.