© 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:
Square. The third derivative is the composite.
CompositeShape keeps a list of many
Shape instances. When called on
Draw() delegates that method to all the
Shape instances in the list.