general hierarchy | - Create an abstract «Node» class to represent the features possessed by each object in the hierarchy.
- Then create at least two subclasses of the «Node» class.
- One of the subclasses, «SuperiorNode», must be linked by a «subordinates» association to the superclass; whereas at least one subclass, «NonSuperiorNode», must not be.
- The subordinates of a «SuperiorNode» can thus be instances of either «SuperiorNode» or «NonSuperiorNode».
| the Reflexive Association pattern, the Composite pattern (a specialization of the General Hierarchy pattern) | many class diagrams where you often find a set of objects that have a naturally hierarchical relationship. | - You want a flexible way of representing the hierarchy that naturally prevents certain objects from having subordinates
- You also have to account for the fact that all the objects share common properties and operations
| How do you draw a class diagram to represent a hierarchy of objects, in which some objects cannot have subordinates? | A pattern in which two classes are related both by a generalization and by a one to many association, such that the generated graph of instances forms a hierarchy | modelling a hierarchy of categories using a hierarchy of classes | 6.3 - The General Hierarchy Pattern | | design pattern |