The Composite Pattern allows you to compose objects into a tree structure to represent the part-whole hierarchy which means you can create a tree of objects that is made of different parts, but that can be treated as a whole one big thing. Composite lets clients to treat individual objects and compositions of objects uniformly, that’s the intent of the Composite Pattern.
Via a real life example, you will learn how and when the Composite design pattern should be used and how to structure your code in order to implement it. You will see how it can lead to elegant solutions to code problems.