April 2021
Intermediate to advanced
842 pages
15h 37m
English
With strategies for generating objects covered, we’re free now to look at some strategies for structuring classes and objects. I will focus in particular on the principle that composition provides greater flexibility than inheritance. The patterns I examine in this chapter are once again drawn from the Gang of Four catalog.
The Composite pattern: Composing structures in which groups of objects can be used as if they were individual objects
The Decorator pattern: A flexible mechanism for combining objects at runtime to ...
Read now
Unlock full access