Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

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