Common design Patterns (c + + examples)

Source: Internet
Author: User

Recently, I have learned some common design patterns. And did some tidying up, as a memo. What's wrong with the place welcome to point out:

Command mode

Encapsulates a request as an object so that you can parameterize the customer with different requests, queue requests or log requests, and support revocable operations.

For more information, please visit my personal blog:www.sheyushu.com


Bridging mode (bridge)

Separate the abstract part from its implementation so that they can vary independently.

For more information, please visit my personal blog:www.sheyushu.com



Adapter Mode (Adapter)

Adapter mode (Adapter), which transforms the interface of a class into another interface that the customer wants. The Adapter mode makes it possible for those classes to work together because the interfaces are incompatible and cannot work together.

For more information, please visit my personal blog:www.sheyushu.com


Factory approach (Factory method)

Defines an interface for creating objects, letting subclasses decide which class to instantiate. The Factory Method defers the instantiation of a class to its subclasses.

For more information, please visit my personal blog:www.sheyushu.com


Simple Factory mode (Factory)

For more information, please visit my personal blog:www.sheyushu.com


Status mode (state)

Allowing an object to change its internal state is to change its behavior. The object appears to have modified its class.

For more information, please visit my personal blog:www.sheyushu.com


Abstract Factory mode (Factory)

Abstract Factory provides an interface to create a series of related or interdependent objects without specifying their specific classes.

For more information, please visit my personal blog:www.sheyushu.com


More Design Patterns:www.sheyushu.com

Common design Patterns (c + + examples)

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.