X Tutup
Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 1.39 KB

File metadata and controls

30 lines (22 loc) · 1.39 KB
layout pattern
title Composite
folder composite
permalink /patterns/composite/
categories Structural
tags
Java
Gang Of Four

Intent: Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.

alt text

Applicability: Use the Composite pattern when

  • you want to represent part-whole hierarchies of objects
  • you want clients to be able to ignore the difference between compositions of objects and individual objects. Clients will treat all objects in the composite structure uniformly

Real world examples:

Credits

X Tutup