design mode (C #) series Article index

Source: Internet
Author: User
Tags abstract

Introduced

Class Diagram plus examples of how design patterns are introduced (C #)

Create-mode (creational pattern)

1, design mode (C #)-Abstract Factory model (Abstracts Factory pattern)

Introduced

Provides an interface to create a series of related or interdependent objects without specifying their specific classes.

2, design mode (C #)-builder mode (Builder pattern)

Introduced

The construction of a complex object is separated from its representation, allowing the same build process to create different representations.

3, design mode (C #)-Prototype mode (Prototype pattern)

Introduced

A prototype instance is used to specify the type of object to create, and a new object is created by copying the prototype.

4. Design pattern (C #)-Factory mode (Factory method pattern)

Introduced

Defines an interface for creating objects, allowing subclasses to decide which class to instantiate. Factory method causes the instantiation of a class to be deferred to its subclasses.

5, design mode (C #)-Single case mode (Singleton pattern)

Introduced

Guarantees that a class has only one instance and provides a global access point to access it.

Structural mode (structural pattern)

6, design mode (C #)-Adapter mode (Adapter pattern)

Introduced

Converts the interface of a class into another interface that the customer expects. The adapter mode makes it possible for those classes that could not work together because of incompatible interfaces.

7, design mode (C #)-Bridging mode (bridge pattern)

Introduced

Separates the abstract part from its implementation, so that they can all change independently.

8, design mode (C #)-Combination mode (composite pattern)

Introduced

Group objects into a tree structure to represent a "partial-whole" hierarchy. It enables customers to have consistency with the use of individual objects and composite objects.

9, design mode (C #)-Decorative mode (decorator pattern)

Introduced

Dynamically add some additional responsibilities to an object. In terms of extended functionality, it is more flexible than generating subclasses.

10, design mode (C #)-Appearance mode (façade pattern)

Introduced

Provides a consistent interface for a set of interfaces in a subsystem, and the façade pattern defines a high-level interface that makes the subsystem easier to use.

11, design mode (C #)-The mode of Flyweight (pattern)

Introduced

The use of sharing technology to effectively support a large number of fine-grained objects.

12, design mode (C #)-Agent mode (proxy pattern)

Introduced

Provides a proxy for other objects to control access to this object.

Behavioral patterns (Behavioral pattern)

13, design mode (C #)-Responsibility chain mode (Chain of responsibility pattern)

Introduced

is coupled between the sender and receiver of the request, and allows multiple objects to have the opportunity to process the request. Connect the objects into a chain and pass the request along the chain until an object handles it.

14. Design mode (C #)-Command mode

Introduced

Encapsulates a request into an object so that you can parameterize the client with different requests, queue or log request logs for requests, and support actions that can be canceled.

15, design mode (C #)-Interpreter mode (interpreter pattern)

Introduced

Given a language, defines a representation of its grammar, and defines an interpreter that uses the representation to interpret a sentence in a language.

16, design mode (C #)-Iterator mode (iterator pattern)

Introduced

Provides a way to access each element of an aggregate object sequentially without exposing the internal representation of that object.

17, design mode (C #)-Intermediary mode (mediator pattern)

Introduced

Encapsulates a series of object interactions with a mediation object. Intermediaries do not need to refer explicitly to each other, so that they are loosely coupled and can independently alter their interactions.

18, design mode (C #)-Memo mode (Memento pattern)

Introduced

captures the internal state of an object without damaging the encapsulation, and saves the state outside the object. This allows the object to be restored to its saved state later.

19, design mode (C #)-Observer mode (Observer pattern)

Introduced

Defines a one-to-many dependency between objects so that when the state of an object changes, all objects that depend on it are notified and automatically refreshed.

20, design mode (C #)-Status mode (state pattern)

Introduced

Allows an object to change its behavior when its internal state changes. The object appears to modify the class to which it belongs.

21, design mode (C #)-Strategy mode (strategy pattern)

Introduced

Define a series of algorithms that encapsulate them each, and make them interchangeable. This mode allows the algorithm to be changed independently from the customer using it.

22, design mode (C #)-Template Method mode (Template methods pattern)

Introduced

Defines the skeleton of an algorithm in an operation, and delays some steps into subclasses. Template method enables subclasses to redefine certain steps of the algorithm without altering the structure of an algorithm.

23, design mode (C #)-Visitor mode (Visitor pattern)

Introduced

Represents an operation that acts on each element in an object structure. It allows you to define new operations that act on these elements without changing the classes of each element.

Other

24, design mode (C #)-Provider mode (Provider pattern)

Introduced

A separation of definitions and implementations for an API.

Ok

This series of articles supporting the source code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.