<<< Composite UML Diagram | Index | Composite Benefits and Disadvantages >>> |
Sample program Composite.cpp ( download ) demonstrates complex drawing composed of Shape objects.
The Shapes are organized into a tree using ShapeComposite::add( ) operation.
The program uses uniform interface, namely print( ) operation, to traverse the entire tree, starting from the root node.
<<< Composite UML Diagram | Index | Composite Benefits and Disadvantages >>> |