设计模式

来源:互联网 发布:最惨的男主 知乎 编辑:程序博客网 时间:2024/05/16 06:57

 

设计模式

百度空间以前敲的全没了,重新总结下。

 

创建型

 

1. Factory Method(工厂方法)

2. Abstract Factory(抽象工厂)

3. Builder(建造者)

4. Prototype(原型)

5. Singleton(单例)

 

结构型

6. Adapter Class/Object(适配器)

7. Bridge(桥接)

8. Composite(组合)

9. Decorator(装饰)

10. Facade(外观)

11. Flyweight(享元)

12. Proxy(代理)

 

行为型

13. Interpreter(解释器)

14. Template Method(模板方法)

15. Chain of Responsibility(责任链)

16. Command(命令)

17. Iterator(迭代器)

18. Mediator(中介者)

19. Memento(备忘录)

20. Observer(观察者)

21. State(状态)

22. Strategy(策略)

23. Visitor(访问者)

 

 

 

简单工厂factory

 

 

 

策略模式strategy

 

 

装饰模式decorator

 

代理模式proxy

 

 

原型模式prototype

 

模板方法模式templateMethod

 

外观模式Facede

 

建造模式Builder

 

 

 

抽象工厂Abstract Factory

 

 

状态模式State

 

 

 

适配器模式adapter

 

 

备忘录模式Memento

 

 

组合模式Composite

 

 

 

迭代器模式Iterator

 

单态模式Singleton

 

 

命令模式Command

 

 

 

职责链模式Chain of Responsibility

 

 

 

中介者模式Mediator

 

 

享元模式Flyweight

 

 

 

解释器模式interpreter

 

访问者模式Visitor

 

 

桥接模式Bridge

 

 

 

 

 

 

JavaDemo源码:

https://github.com/dingsai88/StudyTest/tree/master/src/ding/study/designpatterns 

不错的资料

http://www.cnblogs.com/beijiguangyong/archive/2010/11/15/2302807.html

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3 0
原创粉丝点击