Static Class Structure
Client
Component interface.
Component
Leaf and Composite objects.
Leaf
Composite
Component objects
(children).
for each child in children: child.operation()).
Dynamic Object Collaboration
Client object
sends a request to the top-level
Composite object
in the hierarchy.
Component objects
(lower-level Leaf and Composite objects)
recursively, that is,
the request is performed on all objects
downwards the hierarchy.
Composite object may do work of its own
before and/or after forwarding a request,
for example, to compute total prices
(see Sample Code / Example 2).