The Composite design pattern has the intention to represent part-whole as your friends on social media or a tower, as in the picture below.
Why this pattern?
Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly .
Using a composite structure, we…