DesignPattern
The program design is a way of thinking. It is to think about how to solve the problem. The design mode is in the process of solving the problem. The experience of some good ideas, the earliest design mode, people always mention
The work of GOF, which has the earliest number of 23 models together, designed for later learning, especially those who engage in object-oriented programming.
Later design patterns are widely used to various experience integration, and even anti-mode (Antipattern), anti-mode teach you how to avoid some frequent men and similarly not.
The words of this will sort out some design patterns, and the actual part is to use Java, so you will see some pictures and works with the GOF mode, this is to make good use of some Java itself, as for C In terms of work, GOF's book has given a lot of examples.
On some modes, you will find that I use the interface (Interface) to replace the abstract class, which is not the same as the example in the original GOF book, because there is no interface in C , A abstract category that does not have any way, according to the subject characteristics described at the time, can be changed to the interface, which will comply with the characteristics of the Java language in semantics, but you have to know that the interface is completely An abstract category of any method can be interchangeable at some time.
Hereby
UML map is used
Jude is drawn, Jude is a UML tool program written by pure Java, which can run multiple platforms such as Windows, Linux, small size, easy to use.
GOF mode
The following design patterns are my personal experience in my personal experience and work, and add a few imported or derived simple modes.
Creational pattern
The generation of objects requires system resources, so how to generate efficiency, management and operational objects have always been worthy of discussion, and the CREATIONAL mode is related to the establishment of objects. Some guidelines are given in this classification. Direction of design.
Simple Factory Mode Abstract Factory Mode Builder Mode Factory Method Mode Prototype Mode Singleton Mode Registry Of Singleton Mode Structural Mode
How to design a static structure between items, how to complete the inheritance, implementation and dependencies between the objects, which is related to whether the system is designing, whether it is easy to understand, easy to maintain, easy to modify, coupling low, etc. issue. The Structural Mode is just a name, and the mode under the classification gives the various object relationships applicable to different occasions.
DEFAULT Adapter mode Adapter Mode Bridge mode Composite mode Decorator Mode Facade mode Flyweight mode Proxy mode (1) Proxy mode (2) Behaviooral mode
The cooperation behavior between objects constitutes the final behavior of the program, and there is a good behavior interaction between the objects, not only makes the program, but also makes the object's responsibilities more clear, the dynamic structure of the entire program (like It is the object scheduling) more flexible.
Chain of Responsibility Mode Command Mode Interpreter Mode Iterator Mode Mediator Mode MEMENTO Mode OBServer mode State mode Strategy Mode Template Method Mode Visitor Mode Multi-Optical Wear Mode
Multi-execution is used in many applications, especially in web applications, multi-execution is based on the mode of GOF, and how to combine these basic modes to complete multi-execution security requirements in the multi-execution oscillator.
Guarded Suspension Mode Product CONSUMER Mode WORKER THREAD Mode Thread-Per-Message Mode Future mode Read-write-lock mode Two-Phase Termination mode Thread-Specific Storage mode
Reference
The following is an introduction website in Java's actual design mode, starting from the following link, you can find more resources for more design patterns.
Huston Design Pattern The Design Patterns Java Companion Bridge in the Java Design Mode Learning Experience UML Software Engineering