In this chapter we discussed ways in which we can structure our code to increase performance or mitigate incompatibilities between classes or create modular code.
The following table summarizes the structural design patterns:
Design pattern |
Summary |
The façade pattern |
This provides a simple interface for the existing complex functionalities |
The adapter pattern |
This helps in communication between two incompatible existing classes |
The bridge pattern |
This helps in communication between two classes, which are under heavy modification |
The composite pattern |
This enables unified access to a part and part-whole hierarchy |
The decorator pattern |
This adds capabilities to an existing class without changing its behavior |
The flyweight patern |
This improves the memory usage using shared objects |