Role:
Define a series of algorithms that encapsulate them one by one and make them interchangeable. This mode allows the algorithm to be independent of the client that uses it.
Analytical:
In short, the strategy pattern is the encapsulation of an
Role:
Defines a one-to-many dependency between objects, and when the state of an object changes, all objects that depend on it are notified and automatically updated.
UML Structure diagram:
Analytical:
Observer mode is defined as a one-to-many
Role:
The use of sharing technology to effectively support a large number of fine-grained objects.
UML Structure diagram:
Analytical:
Flyweight patterns are often used when you use a large number of objects that can be shared. For example, in
Role:
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.
UML Structure
Role:
Group objects into a tree structure to represent a "partial-whole" hierarchy. Composite makes users consistent with the use of individual objects and grouped objects.
UML Structure diagram:
Abstract base class:
1) Component: Declares an
Role:
Separates the abstract part from its implementation, so that they can all change independently.
UML Structure diagram:
Abstract base class:
1) Abstraction: An abstract class whose implementation is done by implementor.
2) Implementor:
Role:
Converts the interface of a class into another interface that the customer expects. The ADAPT mode makes it possible for those classes that could not work together because of incompatible interfaces.
UML diagram
1 adopt the way of
Role:
Use the prototype instance to specify the type of object to create and create new objects by copying them.
UML Structure diagram:
Abstract base class:
1 Prototype: Virtual base class, base class for all prototypes, providing clone
Role:
The construction of a complex object is separated from its representation, allowing the same build process to create different representations.
UML Structure diagram:
Applies to the following situations:
1 The algorithms for creating
Role:
Provides an interface to create a series of related or interdependent objects without specifying their specific classes.
UML Structure diagram:
Abstract base class:
1) PRODUCTA,PRODUCTB: Represents different types of products, and their
Role:
Defines an interface for creating objects, letting subclasses decide which class to instantiate. Factory method causes the instantiation of a class to be deferred to its subclasses.
UML Structure diagram:
Abstract base class:
1 Product:
Math.Round () There is a problem when rounding:
Math.Round (2.5,0) = 2;
Math.Round (3.5,0) = 4;
2.5 should be equal to 3!
This problem also exists in ASP, but there is a formatnumber in ASP to use, but still do not know how to use?
Explain:
The Extensible Markup Language XML (extensible Markup Language) is developed by the organization of the Consortium. As a new markup language for the substitution of HTML languages, XML has many basic standards, and XML is applied to scientific
VS, the controls are not prompted by default, but what happens when we want the mouse to be placed on a control (as shown below)?
Then we can use ToolTip. This is coded in code.
The process of writing is as follows:
1. Define a tooltip
2, call
This question comes from the forum, how to judge the event has been registered?
Use reflection to remove the delegate instance bound by the event, and then use Getinvocationlist to get all the registered methods.
Code
View Plaincopy to
Using the System.Threading.Interlocked class can improve thread security, specific reference msdn:http://msdn.microsoft.com/zh-cn/library/ System.threading.interlocked.aspx in general, it is unsafe to access global variables in a child thread in
This problem can be confusing to some beginners, on the one hand after the modal form is opened (Form.ShowDialog). The main thread cannot continue with the following transaction; On the other hand, the progress bar in the form is synchronized while
1, what is the construction method?
First, it is a method that is one of the many methods in the class. Second, it has some features that are not available in other methods in the class.
In short, it is a special mission of the method, his
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