23 kinds of software design patterns

23 kinds of software design patterns 

     It was three students Jike professional, after a mid-level software designer in the first half of the 19 years in the coaching book contact 23 kinds of software design patterns and concepts of the role. If you simply just want to set off a soft you just need to understand creational patterns, structural patterns, behavioral patterns are what design patterns, but also keep in mind the definition of each design pattern. I have the latest information on software designer 19 years, there is a need to download.

  Reference: http://c.biancheng.net/view/1320.html

   Link: https: //pan.baidu.com/s/15bY8mUvIchPuCdPQUE6OSw
   extraction code: 7ur2
   because the folder containing sensitive words, so I modified the wording in line with the socialist core values.

Create a schema

  Example 1. Single (the Singleton) mode : only generate an instance of a class, a class provides global access point for external acquire this example, which is limited cases of expansion mode.

  2. Prototype (the Prototype) mode : an object as a prototype, be copied by a plurality of cloned prototypes of a new instance, and the like.

  3. factory method (Factory Method) mode : Define an interface for creating a product, what products subclasses decide by the manufacturer.

  4. abstract factory (AbstractFactory) mode : providing a product family create interface, each subclass can produce a series of related products.

  5. Builder (Builder) mode : a complex object into a plurality of relatively simple part, create them according to different needs and, respectively, into the final construct complex objects.

 

Structural model

  1. proxy (Proxy) mode: to provide a proxy to control access to the object as an object. I.e., indirectly via a proxy client to access the object, thereby limiting, enhance or modify some features of the object.

  2. Adapter (Adapter) mode: converting a class interface clients expect another interface, such as those due to incompatible interfaces based otherwise not able to work together with the work.

  3. bridge (Bridge) mode: an abstraction and separation, so that they may be varied independently. It is achieved by a combination relationship instead of inheritance, and abstraction implemented to reduce the dimensions of the two variable degree of coupling.

  4. decoration (Decorator) mode : Dynamic Object to add some responsibilities, namely to increase its extra features.

  The appearance (the Facade) mode: providing a consistent interface to multiple complex subsystems, these subsystems are more easily accessible.

  6. Flyweight (Flyweight) mode: Use sharing to support effective reuse a lot of fine-grained objects.

  7. The composition (Composite) mode: combining objects into a hierarchical tree structure, so that the user has access to the same combination of the object and the individual objects.

 

Behavioral patterns

  1. Method template (TemplateMethod) mode : the definition of a skeleton algorithm operation, some steps of the algorithm to delay subclass, so that subclasses can without changing the structure of the algorithm redefine certain steps of the algorithm .

  2. Strategy (Strategy) mode: defines a set of algorithms, and each algorithm package together, so that they can replace each other, and the algorithm change does not affect customers using the algorithm.

  3. Command (Command) mode: Encapsulate a request for an object, so that execution of the request and Responsibility requesting separated.

  4. duty chain (Chain of Responsibility) mode : the request passed from one object to the next in the chain, up until the request is acknowledged. Removing the coupling between objects in this way.

  5. State (State) mode : allows an object to change its capacity when its internal state changes.

  6. observers (Observer) mode : many relationship between a plurality of objects, when an object is changed, the change is notified to the plurality of other objects to affect the behavior of other objects.

  7. Mediator (Mediator) mode : Define a mediation object is to simplify the interaction between the original target, reducing the coupling between objects in the system, so that between each other without having to know the original target.

  8. iterator (the Iterator) mode : to provide a sequential access method to a series of data objects in the polymerization, the polymerization without exposing the internal representation of the object.

  9. visitor (Visitor) mode : a collection of elements without changing the premise of providing a variety of ways to access a set of each element, i.e. each element has a plurality of visitor access objects.

  10. Memorandum (Memento) mode: without destruction of the package, obtains and stores the internal state of an object, in order to recover it later.

  11. Interpreter (Interpreter) Mode : how to define the grammar provides language and interpretation of language sentence, i.e., interpreter.

Guess you like

Origin www.cnblogs.com/lavar/p/11183098.html