Composite pattern

GPTKB entity

Statements (30)
Predicate Object
gptkbp:instanceOf Design Pattern
gptkbp:advantage can make it harder to restrict components
can make design overly general
gptkbp:appearsIn gptkb:Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software
gptkbp:benefit makes it easier to add new kinds of components
simplifies client code
gptkbp:category structural pattern
gptkbp:definedIn gptkb:Gang_of_Four_book
gptkbp:example file system directories and files
gptkbp:firstDescribed gptkb:Erich_Gamma
gptkb:John_Vlissides
gptkb:Richard_Helm
gptkb:Ralph_Johnson
https://www.w3.org/2000/01/rdf-schema#label Composite pattern
gptkbp:language gptkb:Java
gptkb:Python
gptkb:C#
gptkb:C++
gptkbp:participants Composite
Leaf
Component
gptkbp:pattern structural
gptkbp:purpose treat individual objects and compositions uniformly
compose objects into tree structures to represent part-whole hierarchies
gptkbp:relatedTo Decorator pattern
Flyweight pattern
gptkbp:UMLRepresentation tree structure
gptkbp:usedIn object-oriented programming
gptkbp:bfsParent gptkb:architecture
gptkbp:bfsLayer 3