Introduction to design patterns and common application scenarios

Create a schema, a total of five categories: factory method pattern, abstract factory pattern, singleton, the builder pattern, prototype model.

Structural model, a total of seven kinds: adapter mode, decorative mode, proxy mode, the appearance mode, bridge mode, combination mode, Flyweight.

Behavioral patterns, a total of eleven kinds: Strategy pattern, the template method pattern, observer mode, iterator pattern, the responsibility chain mode, command mode, the memo mode state mode, the visitor pattern, intermediary model to explain the mode.

 In fact, there are two types: concurrency pattern and thread pool mode.

 

Common scenarios:

Factory mode : IOC is a typical factory pattern

Proxy mode   : AOP proxy is implemented

Shiro core framework: Facade pattern

Singleton  Spring is a single case of default

Invariant pattern  string of eight basic data types are singleton

Future mode  asynchronous calls. That is only to get a contract request, the agreement can later get this thing

Guess you like

Origin www.cnblogs.com/duguangming/p/11407721.html