Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 789 Bytes

File metadata and controls

41 lines (25 loc) · 789 Bytes

Composite

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


Problem:


Structure:

composite_1 composite_2


Participants:

Component:

  • defines the domain-specific interface that Client uses.

Leaf:

  • collaborates with objects conforming to the Target interface.

Composite:

  • defines an existing interface that needs adapting.

Client:

  • adapts the interface of Adaptee to the Target interface.

Pros and Cons:

Pros:


Cons: