March 2019
Intermediate to advanced
336 pages
9h 9m
English
In a scenario where class responsibilities are removed or added, the decorator pattern is applied. The decorator pattern helps with subclassing when modifying functionality, instead of static inheritance. An object can have multiple decorators and run-time decorators. The single responsibility principle can be achieved using a decorator. The decorator can be applied to window components and graphical object modeling. The decorator pattern helps with modifying existing instance attributes and adding new methods at run-time.
The decorator pattern participants are the component interface, the concrete component class, and the decorator class:
Read now
Unlock full access