Design Patterns-Introduction

Source: Internet
Author: User

The classic "Design pattern" a book summed up 23 design patterns, this article according to "Easy to learn design model" a book into three types of design patterns, respectively:

1. Create pattern

2. Structural mode

3. Behavioral patterns

The design patterns included in each type are described in detail below:

1. Create pattern

As mentioned earlier, the division of socialization is becoming more and more fine, natural in the software design is also so, so object creation and the use of objects separated also become an inevitable trend. Because object creation consumes many of the resources of the system, the creation of objects is studied independently, so that creating objects efficiently is an issue to be explored in creating patterns. There are 6 specific creation patterns available for research, namely:

Simple Factory mode (Factory);

Factory method Mode (Factory);

Abstract Factory mode (Factory);

Creator mode (Builder);

Prototype mode (PROTOTYPE);

Singleton mode (Singleton).

Description: Strictly speaking, the simple factory model is not one of the 23 design patterns summed up by Gof.

2. Structural mode

After solving the object creation problem, the composition of the object and the dependencies between the objects become the focus of the developer's attention, because how to design the structure, inheritance and dependency of the object will affect the maintainability of the subsequent program, the robustness of the code, the coupling and so on. The design of the object structure can easily reflect the level of the designer, there are 7 specific structural patterns to be studied, respectively:

Appearance mode (facade);

Adapter mode (Adapter);

Agent mode (proxy);

Decoration mode (Decorator);

Bridge mode (bridges);

Combination mode (Composite);

Enjoy meta mode (Flyweight).

3. Behavioral patterns

After the object's structure and object creation have been solved, the behavior of the object is left behind, and if the object behaves well, the behavior of the object will be clearer and the collaboration efficiency will improve, there are 11 specific behavioral patterns to be studied, namely:

Template method mode;

Observer pattern (Observer);

Status mode (state);

Strategy mode (strategy);

Responsibility chain mode (Chain of Responsibility);

Command mode;

Visitor mode (Visitor);

Mediator mode (mediator);

Memo mode (Memento);

Iterator mode (Iterator);

Interpreter mode (interpreter).

Reference Source: http://www.cnblogs.com/justForMe/archive/2011/07/18/2109211.html

Design Patterns-Introduction

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.