First, design mode overview
Design Pattern is a general design solution for repeated design issues in an object-oriented system, and is systematically naming and power interpretation. --THE Design Patterns Are Descriptions of Communicating Objects and Classes That Are Customized to Solve A General Design PROBLEM in A Particular Context
Design pattern four elements: a. Pattern name (PROBLEM); problem; solution; d. Effect
Second, design mode classification
1. Creative (Creational): Abstraction of the instantiation process of classes, such as Factory Method, Abstract Factory, Builder, Singleton, etc.
2. Structured (structural): combine the class or object to form a larger structure, such as: Adapter, Appel, Bridge, Decorator, etc.
3. Behavioral: How to interact with class or objects and how to assign responsibilities, such as command (Command), Strategy, etc.
Third, the design model is the foundation of the system architecture
1. Design mode is a summary of practice, is the most direct performance of OOP.
2. Patterns supports software structure and reuse: a. Seize the static, dynamic structure, and mutual collaborative relationships in the successful solution of the specific field; b. Patterns has nothing to do with the development language, but established in certain On the basis of the environment, such as: Classic MVC, Factory Method
3. J2EE multi - layer system is mainly composed of architecture design, framework, and multiple design patterns
Fourth, the basic characteristics of design patterns
1. Reuse: is a goal, two important reuse measures: inheritance & composition
2. Interface and implementation: a. The interface remains unchanged, separation brings flexibility; B. Polymorphism
3. DECOUPLE:
Reduce complexity