Composite

The composite pattern composes related objects into tree structures. It is based on recursion (an object is made up of other objects which can in turn be made of other objects). The idea with the composite pattern is to provide a common interface to individual objects and their containers. This makes it easier for the client programs to work with these types of objects.

Quick Reference

Pattern Name Composite
Other Names N/A
Classification Object Structural
Intent allow objects to be made up of other objects and provide a common interface to manipulate all of them.

General Structure

Example

results matching ""

    No results matching ""