Java development in the 23 kinds of Design Pattern

2009-07-04  来源:本站原创  分类:Development  人气:489 

Typically, a design pattern describes a proven viable option. These programs are very common, is a complete definition of the most commonly used model. The general pattern of four basic elements: pattern name (pattern name), the problem (problem), solution (solution), the effect (consequences).

Java design patterns common 23 kinds of the following:

1, the abstract factory pattern (Abstract Factory): to provide a series of related or interdependent to create the interface objects, and without specifying their specific type.

2, adapter mode (Adapter): A type of interface will be converted into a customer interface of hope. Adapter mode as a result of making the original interface is not compatible and can not work with the class can work together.

3, the bridge mode (Bridge): the abstract part of the realization of part of its separation, so that they can change independently.

4, the construction mode (Builder): to construct a complex object that with its separation of the building process so that the same can be said to create different.

5, the responsibility chain (Chain of Responsibility): requests for the lifting of the sender and the receiver between the coupling of multiple objects have the opportunity to deal with this request. These objects will be connected into a chain, and along this chain of transmission of the request until there is an object to deal with it.

6, command mode (Command): a request for an object package, which can be used different parameters to the request of customers; the request queue or the request to record the log, as well as support to cancel the operation.

7, synthetic mode (Composite): the object into a tree structure that "part - whole" hierarchy. It allows customers a single object and composite object has the consistency of the use.

8, decorative patterns (Decorator): an object to dynamically add some additional functions. On the extensions, the sub-class it generated a more flexible manner.

9, window mode (Facade): for a set of subsystem interface to provide a consistent interface, the definition of window pattern of a high-level interface, this interface makes the system easier to use.

10, the factory method (Factory Method): the definition of an interface used to create the object, so that sub-class which decided to instantiate a class. Factory Method to make an example of a class of delay to its subclass.

11, Flyweight pattern (Flyweight): the use of shared technology to effectively support a large number of fine-grained objects.

12, interpreter mode (Interpreter): given a language, the definition of a grammar it said, and the definition of an interpreter, the interpreter explained the use of the express language of the sentence.

13, iterative sub-model (Iterator): provide a way to visit a sequence of polymerization of the various elements of the object, and not exposed to the object's internal said.

14, the mediation model (Mediator): use of an intermediary object to package a series of interactive objects. Intermediaries so that the object does not need explicit internal said.

15, the memorandum mode (Memento): do not undermine the premise of encapsulation, capture the internal state of an object and the object outside the state of preservation. After this object can be restored to the state of preservation.

16, the observer model (Observer): the definition of the object of inter-dependence of a one-to-many relationship, so that when an object changes state, all depend on it have been notified of the object and automatically refresh.

17, the original model model (Prototype): create a prototype example of the specified object type, and copy the prototype through to create a new object.

18, proxy (Proxy): for other clients, a proxy to control access to this object.

19, single-case model (Singleton): to ensure that only one instance of a class and access it to provide a global access point.

20, the state model (State): allows an object to change in its internal state to change its behavior. Modify the object may seem the type to which it belongs.

21, Strategy Mode (Strategy): the definition of a series of algorithms, package them up one by one, and so that they can replace each other. Algorithm makes the model can be independent of changes in the use of its customers.

22, template patterns (Template Method): the definition of an operation of the skeleton algorithm, and some steps will be deferred to the subclasses. Template method subclasses can be made without changing the structure of an algorithm to re-define the specific steps of the algorithm.

23, the visitor pattern (Visitor): a role that a particular object structure of the operation of the various elements. The model can be achieved without changing the type of each element under the premise of the definition of the role of these elements in the new operation.

相关文章
  • Java development in the 23 kinds of Design Pattern 2009-07-04

    Typically, a design pattern describes a proven viable option. These programs are very common, is a complete definition of the most commonly used model. The general pattern of four basic elements: pattern name (pattern name), the problem (problem), so

  • 23 kinds of Design Pattern Mini Manual 2010-05-06

    23 kinds of Design Pattern Mini Manual

  • MM on the recovery from the 23 kinds of Design Pattern 2009-09-28

    1, FACTORY-up MM and ultimately invited to dine, and McDonald's and Kentucky Fried Chicken wings are the wings MM favorite things, although the taste may be different, but no matter what you bring to McDonald's or KFC MM, just to the waiter said, "to

  • Chasing MM with 23 kinds of Design Patterns Java 2010-01-04

    In the Java forum, I saw this article, the author relaxed java language analogy 23 kinds of patterns, there is a good stimulating, but unfortunately did not give a specific meaning, I was in the rear added. These are the most brief, to learn, then I

  • MM from the chase about 23 kinds of Design Patterns Java 2010-06-22

    MM from the recovery of 23 species on Java design patterns 1, FACTORY-chase MM missed, please eat, McDonald's and KFC's wings are chicken wings MM favorites, although tastes vary, but whether you go to McDonald's or with MM KFC, simply said to the wa

  • 23 kinds of design patterns interesting insights 2010-07-28

    23 kinds of interesting insights design patterns Posts by Li Yang editor at 2010-3-17 08:57 1, FACTORY-chase MM missed, please eat, McDonald's and KFC's wings are chicken wings MM favorites, although tastes vary, but whether you go to McDonald's or K

  • MM recovery mode and 23 kinds of design 2009-08-03

    1, FACTORY-up MM and ultimately invited to dine, and McDonald's and Kentucky Fried Chicken wings are the wings MM favorite things, although the taste may be different, but no matter what you bring to McDonald's or KFC MM, just to the waiter said, "to

  • Paoniu and 23 kinds of design patterns (turn) 2010-12-25

    1, FACTORY-chase MM ultimately invited him to dinner, and McDonald's and KFC's chicken wings are chicken wings MM favorite things, although the taste is different, but whether you go to McDonald's or KFC with MM, just to the waiter said, "to the four

  • java ---- 23 kinds of design patterns 2010-10-29

    1, the factory pattern: the client class and the factory class apart. Consumers need a product at any time, simply a request to the factory. Consumers can not modify the acceptance of new products. The disadvantage is when the product is modified, th

  • Java in 23 kinds of design patterns 2009-03-24

    1, Factory mode: Factory class and customer type separately. Consumers at any time required for a product, just to the factory upon request. No need to change the consumer can accept the new products. Disadvantage when the products are modified, the

  • 2.23 kinds of Design Patterns Java Edition - Simple Factory (simple plants) 2010-07-05

    The plant is to generate a so-called one of the products, generate Java, refers to an instance of the. According to parameters to generate examples of applications in a variety of functions are relatively simple, does not require different implementa

  • 3.23 kinds of Design Patterns Java Edition - Abstract Factory (Abstract Factory) 2010-07-05

    Abstract factory pattern is based mainly on needs of different implementations, switch easy to be implemented. For example, a CMS, database storage using Hibernate, TopLink implementation, the default use of Hibernate factory, factory to generate an

  • 3.23 kinds of Design Patterns Java Edition - Factory Method (factory method) 2010-07-05

    Factory Method pattern, the factory method is not responsible for instances of class formation, but by a subclass of the factory method responsible. In the Java application: Iterator class is equivalent to a product category, Collection of the equiva

  • 5.23 kinds of Design Patterns Java Edition - Builder (Construction) 2010-07-05

    JavaMail Java applications in use to the model.

  • 4.23 kinds of Design Patterns Java Edition - Abstract Factory (Abstract Factory) 2010-07-05

    Depressed, how am not the one issued. Simply write it again. Abstract factory pattern: Abstract factory class: - Factory subclass 1 (which generates multiple instances related) - Factory subclass 2 (which generates multiple instances related) Such as

  • 23 kinds of design patterns Experience 2010-03-29

    Factory (factory mode): the object generating process of the closed-control client does not care about the object generating process. Factories for you to complete these trivial matters. Requirements are often different types of production according

  • 23 kinds of design patterns 2010-07-07

    1, the factory pattern: Factory Separate customer class and the factory class. Consumers need a product at any time, you can simply request to the factory. Consumers can not modify the acceptance of new products. Drawback is that when the product cha

  • [Change] Java design pattern learning experience 2010-06-14

    http://tech.it168.com/focus/200902/java-design/index.html http://tech.it168.com/j/2007-05-17/200705170858843.shtml http://tech.it168.com/j/e/2007-05-20/200705201337218.shtml ] [IT168 technical documentation throughout the design mode of a principle:

  • Reading Notes explain design pattern mode (Interpreter pattern) 2010-10-28

    Interpreter Pattern: Given a language, define a representation of its grammar, and define an interpreter, the interpreter uses the representation to interpret sentences in the language. By the definition, does not explain the mode is a commonly used

  • Can be the first choice to learn the basic design pattern 9 2009-09-25

    This article is reproduced for the revision: Object-oriented design model is thinking of a combination of different opinions, GOF classics in his summing up of the 23 kinds of design patterns, can be divided into: the creation of type, structure and