Pattern COMPOSITE


Solution

  1. Define a class that is an abstraction for the primitive objects
  2. Both primitive and composite classes inherit from that class
  3. A composite object contains a collection of primitives
  4. An operation on a composite class is applied to its primitives, results are combined

prev |top |next