Structural patterns are concerned about the composition of classes and objects to form larger structures. These define how each component or entity should be structured to achieve flexible modules that need to interconnect with each other to form a larger system.
Within the structural patterns, there are class patterns and object patterns, the difference between these two is that class patterns describe how inheritance can be used to provide more usable interfaces, while object patterns describe how objects can be arranged into larger structures using object compositing, or by nesting objects within others.
Structural patterns help us attack problems such as:
- Interconnect two classes that cannot work together due to incompatibility of interfaces.
- Compose objects into tree-like structures to represent hierarchies.
- Add tasks to objects dynamically.
- Represent a subsystem using a single class.
- Share objects efficiently.
- In the next bulletins, each of the creational patterns will be deepened, which are: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, and Proxy.