If you still don't understand what is the design pattern?
Then look at the design pattern introducer!
"Java and Mode" directory
1: Foreword learning the importance of the GOF design pattern and the difference in the model
2: GOF design mode A. Creation mode
Design mode Singleton (single / single piece) Hong Kong Mode: Singleton mode guarantees that only one instance is only one instance, and provides a global access point 2002/10/9 update design mode Factory (factory) Methods and abstract plants) use factory models as frequent as New. 2002/10/9 Update Design Mode Composed of wheels steering wheel engine, while assembling these components into cars is also a complex work, Builder The mode is to separate these two situations. The prototype (prototype) for design patterns uses prototype instances to create the type of object and create a new object by copying these prototypes. B. Structural mode
The Adapter (Adapter) of the design mode uses two ways of class regeneration: combination (New) and inheritance (Extends), this already mentioned in "Thinking in Java". Design mode Proxy (agent) takes jive as an example, Analyzing agent mode Facade (facade?) Scalable Using JDBC for different database programming, Facade provides a flexible implementation of different database programming, FACADE is a flexible implementation. The Composite of Design Mode is to use The tree structure is combined into a unit. You introduce you to someone, you are an element in the unit, others do buy you with you, which is equivalent to buying in units. The JIVE is also analyzed in the article. Design mode Decorator (decorator) Decorator is a paint, giving you the beautiful color of your stuff. Design mode Bridge (Bridge) separates "Cowherd Woys" (this should be together, separate them, form two A interface), built a bridge (dynamic combination) design mode Flyweight (shared yuan) provides Java running performance, lowered small and a large number of repetitive classes. C. behavioral mode
Design mode Command (command) What is a behavior package, and Command is the best instructions. Design mode Observer (observer) describes how to use the ready-made OBServer design pattern provided by Java API has been integrated. Entering Java's Collection. In most cases, you don't need to create an Iterator yourself, just load the object into the Collection, use Iterator to traversal. Design mode Template actually introduces you why you want to use Java abstract classes, the principle is simple, use is very common. Design mode Strategy (policy) Different algorithms respective packages, users can choose the required algorithm CHAIN of RESPONSIBILITY (Responsible Chain) of each company, a string of a series, as if you can shoot flowers, of course, if you can do it, don't admit the commit to the next. Design mode Mediator (mediation) Mediator is very like crossroads The traffic lights of the mouth, each vehicle can be interactively interact with traffic lights. The State (state) state of the design mode is an instance that is often encountered in the program, and the status object is easily switched in the state. MEMENTO (Note Status?) In design mode is very simple. It is to keep the original data copy. Design mode Interpreter (interpreter) is mainly used to analyze the language, the application is not much. Design mode Visitor ( Visitors) When visiting, complete a series of substantive operations, and can also be extended.
3: Other information
23 design modes of Java implementation (supplied Sourcecodes) Thinkl's author Eckel is another job! CMSC491D Design Patterns in Java Overview of Design Patterns Precisely defines the various modes and their relationships Design Patterns Java Companion design mode Applying this in EJB This is the article I published in the "programmer". It is very simple to write. EJB Design Mode (English) Understand EJB or J2EE I think it is a very effective way. Thanks to Taiwan's "Space" to translate this site design pattern into traditional Chinese characters and reprinted the netizen David YU to design the design model of this site To a PDF file, download the PDF file transparent personal homepage has more design mode translation