Pattern category of Design Pattern

Source: Internet
Author: User
Pattern category of Design Pattern

Pattern classification:
1. objective criteria for classification
That is, it is classified based on the purpose of the pattern (what purpose,
① Creational ):
Object Creation
(Abstract Factory, build, factory method, prototype, sington)

② Structural)
Processing class or object combination
(Adapter, bridge, composite, decorator, facade, flyweight, proxy)

③ Behavior (behavioral)
Describes how classes or objects interact and how responsibilities are assigned.
(Interpreter, template method, chain of responsibility, command,
Iterator, mediator, memento, observer, state, strage, visitor)

2. Scope criteria Classification
That is, the mode is mainly used for classes or objects.
Class mode, which focuses on the relationship between classes. by inheriting and establishing this relationship, the variation is deterministic and static.
The object mode is more dynamic and can be changed at runtime to process the relationship between objects.

Creation class mode: factory Method
Delays part of the object's work to the subclass.
Creation Object Mode: Other all of creational
Delays object creation to another object.

Structural class mode: adapter (class)
Use Inheritance Mechanism to combine classes
Structure Object Mode: adapter (object) and other all of structural
Describes how objects are assembled.

Behavior class mode: Interpreter, template method
Use inheritance to describe the algorithm and Control Flow
Behavior Object Mode: Other all of behavioral
Describes how a group of objects can collaborate to complete tasks that cannot be completed by a single object.

The above is a summary of the classification of design patterns.

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.