Structural_Composite Pattern
β Composite pattern
π² tree structure
- Client will not know if it is using
compositeorleaf - can treat the
groups of objectsorindividual objectsin same manner - ππ» part whole hierarchy
- composite objects into tree structure
- treat individual objects and composite objects uniformly
βοΈ Structure of the composite pattern
- component: common interface
- declare operations common to composite and leaf
- composite: groups of object, can have other
componentas attribute - leaf: last of tree(no children)
β Diagram
β
β
β
This post is licensed under CC BY 4.0 by the author.
