Returns the design mode (C #) series Article index
Introduced
captures the internal state of an object without damaging the encapsulation, and saves the state outside the object. This allows the object to be restored to its saved state later.
Returns the design mode (C #) series Article index
Introduced
Provides a proxy for other objects to control access to this object.
Example
There is a message entity class where an object has an insert () and a Get () method for its operation,
Returns the design mode (C #) series Article index
Introduced
Guarantees that a class has only one instance and provides a global access point to access it.
Example
Ensure that a class has only one instance.
Singleton
using System; using
The main reference is "Big talk design mode" and "design pattern: The basis of reusable object-oriented software" two books. This article describes the implementation of the mediator pattern.Broker mode: What it is:define an object, that
Prototype mode: Specifies the kind of object created with the prototype instance, and creates a new object by copying the prototypes. The central idea is cloning. For example, we often need to copy the ID card, sometimes need a few, in fact, is
daily cooking process, often forget to put salt or put 2 times salt experience, and finally lead to a good dish so that everyone can not swallow. This time need to use the builder model to standardize the process of cooking, to ensure that each dish
Transferred from: Model-engineering implementation and expansion (Design Mode C)
Http://www.cnblogs.com/callwangxiang/
Bytes
Reference answer
Design Points:
Use a coherent interface to design the table creation
The design patterns in the software field provide developers with an effective way to use expert design experience. The design patterns use the important features of object-oriented programming languages: encapsulation, inheritance, and polymorphism.
Big talk Design Mode C ++-builder mode and big talk Design ModeIn the course of daily cooking, we often forget to put salt or put salt twice. In the end, a good dish makes it impossible for everyone to get started. In this case, the builder mode is
Vistor visitor mode (C ++ visitor Mode)
The Visitor mode provides new operations for the class without damaging the class.
The Visitor mode is often used to encapsulate the update design in a class, and the class to be changed provides an interface
Iterator mode (C ++ iterator mode) and Iterator Mode
Basically speaking, the Iterator mode is nothing to say, and there are too many ideas in STL. It is generally used to traverse data structures and its implementation is relatively simple.
The
When we are dealing with simple objects and complex objects, if they have commonalities, then we can use a unified interface, allowing users to better manipulate different
When we cannot or do not need direct access to a role for some reason, we can implement our specific behavior through proxy objects, which are similar to the role of
The policy pattern defines a series of algorithms, encapsulates each algorithm, and allows them to be replaced with each other. The policy pattern makes the algorithm independent of the customers who use it.Abstract Policy Roles: A policy class,
IntroducedIntent : Convert the interface of the class to another interface that the customer expects. The adapter mode makes it possible for those classes that would otherwise not work together because of incompatible interfaces to work together. is
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.