Categories: Design Pattern

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

davidsky69

Recent Posts

API Gateway in .NET 5 with Ocelot

What is the API gateway? An API gateway is an API management tool that sits…

4 years ago

.NET 5 application with Onion architecture

The .NET 5 SDK is a kind of milestone in the .NET world. The .NET…

4 years ago

SOLID Principles – Dependency inversion principle

In object-oriented design, the dependency inversion principle is a specific methodology for loosely coupling software…

4 years ago

SOLID Principles – Interface segregation principle

In the field of software engineering, the interface segregation principle (ISP) states that no code…

4 years ago

SOLID Principles – Liskov substitution principle

Subtype Requirement: Let  be a property provable about objects  of type T. Then  should be true for objects  of type S where S is…

4 years ago

SOLID Principles – Open-closed principle

In object-oriented programming, the open–closed principle states "software entities (classes, modules, functions, etc.) should be…

4 years ago