Design Patterns – Structural Patterns
The structural patterns mean that organize different classes and objects that structure larger structures and then provide the new functionality. The structural patterns have more ways to implement, such as Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Private Class Data, and Proxy.
From Design Pattern – Introduction
The structural pattern is an easy way to make the design pattern. It implements realize the relationship between entity objects and focuses on the objects and the class combination. Most way uses the inheritance method to combine the interface class and the define composite objects to new functions or new objects.
- Adapter – Allows unrelated objects with an incompatible interface to collaborate.
- Bridge – Separates an object’s interface from its implementation – abstraction layer and implementation layer, which can be developed independently of each other.
- Composite – Lets the compose objects into the tree structures, and then according to the tree structures to composite them, which uses the part description and the overall layer to descript.
- Decorator – Add new behaviors to the object without modifying the object architecture and keep existing behaviors.
- Facade – A single class that represents an entire subsystem that hides the system complexity.
- Flyweight – A fine-grained instance is used for efficient sharing. Reduce the create object number and memory occupation, then improve the performance.
- Private Class Data – Restricts accessor/mutator access. Control write access to object attributes and separate data from function to use it. Encapsulate class data initialization.
- Proxy – An object representing another object, allowing do something from the original object.
- Filter/Criteria – According to the developer logic and decouple methods to connect, which uses the different standard rules to filter.
Note: All demo samples will build in the .NET Core case project so if you want to see the complete source code in everyone’s pattern articles, please, click the Github repository – Enterprise_MVC_WebApp.
Reference
- Refactoring.Guru – Structural Design Patterns
- Runoob.com – Design pattern
- Source marking – Structural patterns