设计模式总结: 5种创建型,7种结构型,11种行为型

来源:互联网 发布:linux tomcat日志分割 编辑:程序博客网 时间:2024/06/05 21:34

设计模式总结: 5种创建型,7种结构型,11种行为型


5种创建型:
工厂方法模式factory
抽象工厂abstactfactory
单例模式singleton
建造者模式builder
原型模式prototype


7种结构型:
桥接模式bridge
适配器模式adapter
装饰器模式decorator
组合模式composite
享元模式flyweight
外观模式facade
代理模式proxy


11种行为型:
1.模板方法模式template
2.策略模式strategy


两个类之间:
3.观察者模式observer
4.迭代子模式iterator(容器与容器遍历)
5.责任链模式chain of responsibility(责任链模式)(串的替换---可以使用链式操作)
6.命令模式command


类的状态:
7.备忘录模式memento
8.状态模式state


通过中间类:
9.访问者模式visitor
10.中介模式mediator
11.解释器模式interpreter
阅读全文
0 0