The composite design pattern is most
appropriate when:
We are likely to modify the program to add new object types, but the basic operations stay the same.
- We are likely to modify the program to add new operations, but the basic object types stay the same.
- We need to encapulate and make interchangeable a set of alternative actions that might be performed as part of some larger activity.
The standard "tree in control" design is good when we need
to add operations to an unchanging class hierarchy.
Composite is not about interchangeable actions.
In contrast to "tree in control", composite is good when
the class hierarchy is likely to change.