Java design patterns Summary

Java design patterns can be divided into three categories

Create a schema

I understand, create an abstract object, select the appropriate combination of business scenarios to create models, design patterns in the book is the accumulation of engineering experience, is always useful to remember several templates

Factory Pattern

Singleton ......

 

Combined mode

I understand it, an abstract interface, listening to the name to know is to combine different types of models

Proxy mode

Adapter mode

Decorator ......

 

Behavioral patterns

 I understand it, an abstract act, and then the above interface differences: the behavior is complex, the interface can be understood as a call to action, action and behavior is a combination of a series of actions (call interface) composed behavior, behavior abstract obtain behavioral patterns

Observer Pattern

Duty chain.

Command Mode ......

 

These three categories are design patterns, but the actual software engineering activities, the use of design patterns vague, not so clear business scenarios for some design patterns

So need to combine business scenarios select the most appropriate design pattern

example

https://my.oschina.net/xianggao/blog/660005

To be continued ......

 

Guess you like

Origin www.cnblogs.com/shineyoung/p/11612527.html