The composite pattern describes a group of objects that is treated the same way as a single instance of the same type of object.
The intent of a composite is to "compose" objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly.
Purpose
Composing structures in which groups of objects can be used as if they were individual objects.
Implementation
The Decorator Pattern
The decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class.
Purpose
A flexible mechanism for combining objects at runtime to extend functionality.
Implementation
The Facade Pattern
The facade pattern is a software-design pattern commonly used with object-oriented programming. Analogous to a facade in architecture, a facade is an object that serves as a front-facing interface masking more complex underlying or structural code.
Purpose
Creating a simple interface to complex or variable systems.
Implementation
In this implementation, the creation and initialization of subsystems are hard wired into the code; this can be avoided by entering the factory pattern or using a
parameterized constructor for the facade.
Summary
In this post, I looked at a few of the ways that classes and objects can be organized in a system.