CHAPTER 9The Composite Pattern
The composite is a design pattern that is tailor-made for creating dynamic user interfaces on the Web. Using this pattern, you can initiate complex or recursive behaviors on many objects with a single command. This allows your glue code to be simpler and easier to maintain, while delegating the complex behaviors to the objects.
- It allows you to treat a collection of objects the same as you would treat any of the particular sub-objects. A composite implements the same operations as its constituent objects. Executing one of these operations on the composite passes it down to all of its children. Each one then executes the same operation. ...