Design Patterns
Structural Design Patterns
Structural Design Patterns
Structural design patterns deal with object composition, creating relationships between objects to form larger structures. These patterns focus on how objects can be composed to obtain new functionality.
There are several types of structural design patterns, including the adapter, bridge, composite, decorator, facade, and flyweight patterns.
- The adapter pattern allows two incompatible interfaces to work together by wrapping one interface with the other.
- The bridge pattern decouples an abstraction from its implementation, allowing the two to vary independently.
- The composite pattern allows you to compose objects into tree structures, and treat individual objects and compositions of objects uniformly.
- The decorator pattern allows you to add new behavior to existing objects dynamically by wrapping them in a decorator object.
- The facade pattern provides a simplified interface to a complex subsystem, hiding its internal complexity.
- The flyweight pattern conserves memory by sharing common data among objects, rather than storing identical data in each object.