JavaScript Design Patterns Research Learning-Design pattern categories

Source: Internet
Author: User

One of the most important aspects of writing easy-to-maintain code is the ability to find and optimize the body of code that recurs. This is also a valuable part of the design pattern.

Design Pattern Categories:

First, the creation of design patterns
Creation design pattern partitioning focuses on working with object creation mechanisms to create objects in a way that is appropriate for a given situation. The basic approach to creating objects can lead to an increase in project complexity, which is designed to address this problem by controlling the creation process.

Can be broadly divided into:

  1. Constructor (constructor)
  2. Factory (Factory)
  3. Abstract (abstraction)
  4. Prototype (prototype)
  5. Singleton (single case)
  6. Builder (builder)

    Second, structural design mode

Structured design patterns are related to object combinations and can often be used to identify simple ways to establish relationships between different objects. This pattern helps ensure that the entire structure of the system does not need to change at the same time when a change is made to a certain part of the system, and that this pattern can help them complete the reorganization for parts of the system that are not suitable for a particular purpose.

Patterns that fall into this category include:

  1. Decorator (decorator)
  2. Facade (appearance)
  3. Flyweight (enjoy Yuan)
  4. Adapter (Adapter)
  5. Proxy (agent)

Iii. Patterns of behavior

Behavioral patterns focus on improving or simplifying communication between different objects in the system.

Behavior patterns include:

  1. Iterator (iterator)
  2. Mediator (intermediary)
  3. OBSERVER (Observer)
  4. Visitor (visitor)

JavaScript Design Patterns Research Learning-Design pattern categories

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.