Structural Design Patterns
Structural design patterns are design patterns that are mainly focusing on how to use objects (e.g. Performance, memory utilization, interception).
- Adapter
If an interface of another class needs to be used as another interface, use this pattern.
- Bridge
If the abstraction need to be decoupled from the implementation and allowing both to be modified without affecting each other, use this pattern.
- Composite
If the intent is to have some objects of the same type into tree structure, use this pattern.
- Decorator
If adding a behavior to an object of the same type dynamically at runtime without affecting their own behavior, use this pattern.
- Facade
If the need of have a simplified interface from a complex and difficult to use API because of the large interdependent classes or the codes is not accessible, use this pattern.
- Filter (a.k.a. Criteria)
If the intent is to filter a set of objects using different criteria and has the capability to chain them in a decoupled way, use this pattern.
- Flyweight
If the desire to conserve memory by sharing as much data as possible, use this pattern.
- Proxy
If there's a need for a class to function as an interface to something else, use this pattern. The proxy can just forward to the a real object or provides some additional logic.