Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 500 Bytes

File metadata and controls

19 lines (12 loc) · 500 Bytes

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