This month's meeting will be an in-depth review of the Decorator design pattern.
Design patterns are "simple and elegant solutions to specific problems in object-oriented software design." 1
The Decorator pattern attaches additional responsibilities to an object dynamically, and provides an alternative to subclassing for extending functionality.
The overuse of subclassing can lead to class explosion and the need to add functionality inside a base class that may not be appropriate for some its subclasses.
Decorator extends an object's behavior through composition, i.e, a decorator object that has-a component object it wants to decorate.
|