🌱Aadam's Garden

Search

Search IconIcon to open search

Composite Pattern

Last updated Aug 15, 2022

Source:: Software Design Patterns - Best Practices for Software Developers


Definition

The composite pattern is defined as composing objects into tree structures to represent part-whole hierarchies, thus letting clients uniformly treat individual objects and composition of objects.

This allows us to treat both individual objects and compositions in a uniform manner, meaning that the same behavior will be applied regardless of whether we’re working with one item or a thousand.

# Resources