July 2006
Intermediate to advanced
768 pages
16h 43m
English

© Jennifer M. Kohnke
A composite is a euphemism for a lie. It’s disorderly. It’s dishonest and it’s not journalism.
—Fred W. Friendly, 1984
The COMPOSITE pattern is a very simple pattern that has significant implications. The fundamental structure of the COMPOSITE pattern is shown in Figure 31-1. Here, we see a hierarchy based on shapes. The Shape base class has two derivative shapes: Circle and Square. The third derivative is the composite. CompositeShape keeps a list of many Shape instances. When called on CompositeShape, Draw() delegates that method to all the Shape instances in the list.
Figure 31-1. COMPOSITE pattern
Thus, ...
Read now
Unlock full access