<<< Bridge Sample | Index | Composite UML Diagram >>> |
Problem to solve:
When dealing with tree-structured data, programmers often have to discriminate between a leaf-node and a branch.
This makes code more complex, and therefore, error prone.
Solution:
The solution is an interface that allows treating complex and primitive objects uniformly.
The objects are composed into tree structures to represent part-whole hierarchies.
Composite lets clients treat both individual objects as well as object compositions uniformly.
<<< Bridge Sample | Index | Composite UML Diagram >>> |