Talking about programming design pattern

Source: Internet
Author: User

Design patterns are divided into three types: created, structured, and behavioral.     Among them are: First, Singleton, Singleton mode: Ensure that a class has only one instance, and provide a global access point to access it. Abstract Factory, Abstraction Factory: Provides an interface to create a series of related or interdependent objects without specifying their specific classes.     Factory method, Factory methods: Define an interface for creating objects, let subclasses decide which class to instantiate, and Factory method to defer instantiation of a class to subclasses.     Builder, Build mode: Separates the construction of a complex object from his presentation, allowing the same build process to create different representations. V. Prototype, prototype mode: Specifies the kind of object created with the prototype instance, and creates a new object by copying the prototypes.     Behavioral types are: VI, Iterator, iterator pattern: Provides a way to sequentially access individual elements of an aggregated object without exposing the object's internal representation.     VII. Observer, Observer pattern: Defines a one-to-many dependency between objects, and when an object's state changes, all objects that depend on it are notified of Automatic Updates.     Template method: Define the skeleton of an algorithm in an operation, and defer some steps into the subclass, Templatemethod so that subclasses can redefine the algorithm to some specific steps without changing the structure of an algorithm.     commands, Command mode: Encapsulates a request as an object, allowing you to parameterize the customer with different requests, queue requests and log requests, and support revocable operations. State mode: Allows an object to change his behavior when its internal state changes.     The object seems to have changed his class.     XI. strategy, Strategy mode: Define a series of algorithms, encapsulate them one by one, and allow them to replace each other, this mode allows the algorithm to be independent of the customers who use them.     12, China of Responsibility, responsibility chain mode: Enables multiple objects to have the opportunity to process the request, thus avoiding the coupling between the communicated and Receiver of the request 13, mediator, Broker pattern: Object interaction that encapsulates some columns with a mediation object.     14. Visitor, Visitor mode: represents an operation that acts on elements of an object structure, allowing you to define new actions that act on this element without changing the individual element classes. XV, interpreter, interpreter mode: Given a language,Define a representation of his grammar and define an interpreter that interprets the sentences in the language using that representation. 16. Memento, Memo mode: captures the internal state of an object without destroying the object, and saves the state outside the object.     Structural type: 17, Composite, combined mode: combine objects into a tree structure to represent a part of the overall relationship, Composite makes the user consistent with the use of individual objects and composite objects.     18, facade, appearance mode: To provide a consistent interface for a set of interfaces in the subsystem, Fa?ade provides a high-level interface, which makes the subsystem easier to use.     19, Proxy, Agent mode: For other objects to provide a proxy to control access to this object 20, Adapter, adapter mode: To convert a class of interfaces to another interface that the customer wants, Adapter mode makes it impossible to work together those classes that are incompatible with the interface.     21, Decrator, Decoration mode: Dynamically add some additional responsibilities to an object, the decorator mode is more flexible than generating subclasses in terms of the added functionality.     22. Bridge mode: Separates the abstract part from its realization, so that they can change independently. 23, Flyweight, enjoy meta mode

Talking about programming design mode

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.