23 basic introduction to the Design Pattern

Source: Internet
Author: User

Creational Pattern)
1. abstract factory pattern)
Introduction
Provides an interface for creating a series of related or mutually dependent objects without specifying their specific classes.

2. Builder Pattern)
Introduction
Separates the construction of a complex object from its representation, so that different representations can be created during the same construction process.

3. Prototype Pattern)
Introduction
Use a prototype instance to specify the type of the object to be created, and copy the prototype to create a new object.

4. Factory method pattern)
Introduction
Defines an interface for creating objects, so that the subclass determines which class to instantiate. Factory method delays the instantiation of a class to its

Subclass.

5. Singleton pattern)
Introduction
Ensure that a class has only one instance and provides a global access point to it.

Structural Pattern)
6. Adapter Pattern)
Introduction
Converts an interface of a class to another interface that the customer wants. The adapter mode makes it impossible to work together because the interface is incompatible.

Some classes can work together.

7. Bridge pattern)
Introduction
Separate the abstract part from its implementation part so that they can all change independently.

8. composite pattern)
Introduction
Combine objects into a tree structure to represent the "part-whole" hierarchy. It makes the customer's use of a single object and a composite object consistent.

.

9. decorator pattern)
Introduction
Dynamically add some additional responsibilities to an object. The extended function is more flexible than the subclass generation method.

10. Facade Pattern)
Introduction
Provides a consistent interface for a group of interfaces in the subsystem. The facade mode defines a high-level interface, which makes the subsystem more

Easy to use.

11. flyweight Pattern)
Introduction
Use the sharing technology to effectively support a large number of fine-grained objects.

12. proxy pattern)
Introduction
Provide a proxy for other objects to control access to this object.

Behavioral Pattern)
13. chain of responsibility pattern)
Introduction
To cancel the coupling between the request sender and receiver, multiple objects have the opportunity to process the request. Link these objects into a chain and

This request is passed along this chain until an object processes it.

14. Command pattern)
Introduction
Encapsulate a request as an object, so that you can parameterize the customer with different requests; queue requests or record request logs

And supports cancelable operations.

15. interpreter mode (Interpreter pattern)
Introduction
Given a language, it defines a syntax expression and an interpreter that uses this representation to interpret sentences in the language.

16. iterator Pattern)
Introduction
Provides a method to access each element in an aggregate object sequentially without exposing the internal representation of the object.

17. Mediator Pattern)
Introduction
An intermediary object is used to encapsulate a series of object interactions. The intermediary makes the objects do not need to be explicitly referenced to each other, so that the coupling is loose.

The interaction between them can be changed independently.

18. Memento Pattern)
Introduction
Capture the internal state of an object without compromising encapsulation, and save the state outside the object. In this way, you can

To the saved status.

19. Observer Pattern)
Introduction
Define a one-to-many dependency between objects so that when the state of an object changes, all objects dependent on it are notified and

Automatically refresh.

20. State Pattern)
Introduction
Allows an object to change its behavior when its internal state changes. The object seems to have modified its class.

21. Strategy Pattern)
Introduction
Define a seriesAlgorithm, Encapsulate them one by one, and make them replace each other. This mode makes the algorithm changes independent of use.

Its customers.

22. template method pattern)
Introduction
Defines the skeleton of an algorithm in an operation, and delays some steps to the subclass. The template method makes it possible for the subclass to not change a calculation.

To redefine some specific steps of the algorithm.

23. Visitor pattern)
Introduction
Indicates an operation that acts on each element in an object structure. It allows you to define and act on these elements without changing the classes of each element.

New operation.

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.