The Composite Pattern
¥
The DeptDirectory class
hierarchy is a special form of union called a composite. A union is
composite when one or more
variants contain fields of the root class
type. In other words, variants in the union
contain references to objects of union type. In the DeptDirectory example, the NonEmpty variant
contains a field rest of type DeptDirectory.
¥