mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 12:59:00 +00:00
5ce932ceb7
- properly categorize all patterns - remove pattern list from readme - minor fixes to readme - removed "introduction" because its not a pattern and an error i committed some time ago
1.2 KiB
1.2 KiB
layout, title, folder, permalink, categories, tags
| layout | title | folder | permalink | categories | tags |
|---|---|---|---|---|---|
| pattern | Composite | composite | /patterns/composite/ | Structural | Java |
Intent: Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
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:
- java.awt.Container and java.awt.Component
- Apache Wicket component tree, see Component and MarkupContainer
