Composite

E173610

Composite is a structural design pattern that lets you treat individual objects and compositions of objects uniformly by organizing them into tree-like hierarchies.

All labels observed (3)

Label Occurrences
Composite canonical 1
Composite pattern 1
ConcreteComponent 1

How this entity was disambiguated

Statements (47)

Predicate Object
instanceOf software design pattern
structural design pattern
appliesTo document and text structures
file system directory structures
graphical user interface components
scene graphs in graphics engines
belongsTo Design Patterns: Elements of Reusable Object-Oriented Software
surface form: Gang of Four design patterns
benefit makes it easy to add new kinds of components
promotes consistent use of interfaces
simplifies client code
supports polymorphic behavior over hierarchies
classification object structural pattern
ClientRole treats all objects in the composition uniformly
ComponentRole declares interface for objects in the composition
CompositeNodeResponsibility aggregates results from children
forwards requests to children
implements child-related operations
stores child components
CompositeNodeRole represents objects that have children
definesRole Client
Component
Composite node
Leaf
describedIn Design Patterns: Elements of Reusable Object-Oriented Software
enables hierarchical object structures
transparent handling of leaf and composite nodes
uniform treatment of individual and composite objects
hasIntent treat individual objects and compositions of objects uniformly
keyIdea clients use the Component interface to interact with all objects in the hierarchy
LeafResponsibility does not have children
implements behavior for primitive objects
LeafRole represents primitive objects in the composition
oftenUsedWith Iterator design pattern
Visitor design pattern
organizesInto tree-like hierarchies
originatedBy Erich Gamma
surface form: Erich Gamma et al.
relatedTo Iterator design pattern
Visitor design pattern
supports part-whole hierarchies
recursive object composition
recursive traversal of structures
supportsOperation add(Component) on composite nodes
getChild(int) on composite nodes
remove(Component) on composite nodes
tradeoff can make design overly general for simple structures
can make it harder to restrict components in a composite
typicalOperation operation() called on Component interface

How these facts were elicited

Referenced by (3)

Full triples — surface form annotated when it differs from this entity's canonical label.

Decorator structureElement Composite
this entity surface form: ConcreteComponent
Decorator relatedTo Composite
this entity surface form: Composite pattern