23 Design Patterns in the book of design Patterns

Source: Internet
Author: User

The following 23 design patterns are mentioned in the design pattern book:

Abstractfactory: Provides an interface to create a series of related or interdependent objects without specifying their specific classes.
Adapter: Transforms the interface of a class into another interface that the customer wants. The adapter mode makes it possible for those classes that would otherwise not work together because of incompatible interfaces to work together.
Bridge: Separates the abstract part from its implementation, so that they can all change independently.
Builder: Separates the construction of a complex object from its representation so that the same build process can create different representations.
Chainofresponsibility: A coupling between the sender and receiver of the cancellation request, allowing multiple objects to have the opportunity to process the request. Link the objects together and pass the request along the chain until an object handles it.
Command: Encapsulates a request as an object so that you can parameterize the customer with different requests, queue up requests or log requests, and support actions that can be canceled.
Composite: Combines objects into a tree structure to represent a "partial-whole" hierarchy. Composite enables customers to have consistent use of individual objects and composite objects.
Decorator: Dynamically adds some additional responsibilities to an object. In terms of extended functionality, the decorator mode is more flexible than the way the subclass is generated.
Facade: Provides a consistent interface for a set of interfaces in a subsystem, and the facade schema defines a high-level interface that makes this subsystem easier to use.
FactoryMethod: Defines an interface for creating objects, so that subclasses decide which class to instantiate. FactoryMethod defers the instantiation of a class to its subclasses.
Flyweight: Use sharing technology to effectively support a large number of fine-grained objects.
Interpreter: Given a language, defines a representation of its grammar and defines an interpreter that uses that representation to interpret sentences in the language.
Iterator: Provides a way to sequentially access individual elements of an aggregated object without exposing the object's internal representation.
Mediator: Encapsulates a series of object interactions with a mediation object. The mediator makes the objects not need to explicitly reference each other, so that they are loosely coupled, and can independently change the interaction between them.
Memento: Captures the internal state of an object without compromising encapsulation, and saves the state outside that object. The object can then be restored to the saved state.
Observer: Defines a one-to-many dependency between objects so that when the state of an object changes, all objects that depend on it are notified and refreshed automatically.
Prototype: Specifies the kind of object created with the prototype instance, and creates a new object by copying the prototype.
Proxy: Provides a proxy for other objects to control access to this object.
Singleton: Guarantees that a class has only one instance and provides a global access point to access it.
State: Allows an object to change its behavior when its internal states change. The object appears to have modified the class it belongs to.
Strategy: Define a series of algorithms, encapsulate them one by one, and make them interchangeable with each other. This mode allows the algorithm to be changed independently of the customer using it.
Templatemethod: Defines the skeleton of an algorithm in an operation, and delays some steps into subclasses. Templatemethod allows subclasses to redefine some specific steps of the algorithm without altering the structure of an algorithm.
Visitor: Represents an operation that acts on elements in an object's structure. It allows you to define new actions that act on these elements without changing the class of each element.

23 Design Patterns in the book 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.