As programmers, we use structural patterns to improve the overall structure of our code. So, when code is encountered that lacks structure and is not at its cleanest, we can use the patterns mentioned in this section to restructure the code and make it clean. There are seven structural design patterns:
- Adapter:Use this pattern to enable classes with incompatible interfaces to work cleanly together.
- Bridge: Use this pattern to loosely couple code by decoupling an abstraction from its implementation.
- Composite: Use this pattern to aggregate objects and provide a uniform way of working with individual and object compositions.
- Decorator: Use this pattern to keep the interface the same while dynamically adding new functionality to the object.
- Façade: Use this pattern to simplify larger and more complex interfaces.
- Flyweight:Use this pattern to conserve memory and pass shared...