The Composite pattern is used when we need to treat both a group of items and a single object in the same manner. The composite pattern arranges elements in a tree structure to show both partial and complete hierarchies.
Examples of composite patterns are:
The UML class diagram above includes the following classes, interfaces, and objects: