Object Oriented Software Engineering   View all facts   Glossary   Help
subject > pattern > design pattern > general hierarchy
Next design patternimmutable    Updesign pattern    Previous design patternfacade   

general hierarchy comparison table
Subject have solution have related patterns have context have forces have problem has definition have antipatterns is a subtopic of is a kind of is an instance of
design pattern zero or more related design patternsa contextone or more forcesa sentence or two explaining the main difficulty being tackledA pattern useful for the design of softwarezero or more antipatterns - solutions that are inferior or do not work in this context with the reason for their rejection6.1 - Introduction to Patternspattern 
general hierarchy
  1. Create an abstract «Node» class to represent the features possessed by each object in the hierarchy.
  2. Then create at least two subclasses of the «Node» class.
  3. One of the subclasses, «SuperiorNode», must be linked by a «subordinates» association to the superclass; whereas at least one subclass, «NonSuperiorNode», must not be.
  4. 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 hierarchymodelling a hierarchy of categories using a hierarchy of classes6.3 - The General Hierarchy Pattern design pattern

Next design patternimmutable    Updesign pattern    Previous design patternfacade