Skip to content

Files

Latest commit

43e5eae · May 31, 2024

History

History

Composite

Composite Pattern

Structural Type

Use cases:

this pattern is used when we want to represent a hierarchy and we want to treat the object of the hierarchy the same way;

Classes

  • Leaf - represents an individual part
  • Composite - group class or container class

Interfaces

  • Component - contains operation method that common between Leaf and Composite

Visual Diagram

Visual Diagram Composite Pattern

image by refactoring guru