不同设计模式解决的问题(完善中。。)
2017-02-06 16:10
225 查看
具体的设计模式,网上有很多介绍。本人参见 journaldev
模式 | 解决问题 |
---|---|
Builder | Too Many arguments to pass from client program to the Factory class |
Factory | when we have a super class with multiple sub-classes and based on input, we need to return one of the sub-class |
Prototype | When u need clone an existing object (shallow or deep copy) |
Strategy | Define multiple algorithms and let client application pass the algorithm to be used as a parameter |
Decorator | modify the functionality of an object at runtime |
Composite | When we need to create a structure in a way that the objects in the structure has to be treated the same way |
Bridge | Using abstract class replacing implement class to decouple |
Facade | Unify a set of interfaces in a subsystem |
Template method | define common functions in abstract class for all sub class |
相关文章推荐
- 学习笔记-设计模式GRASP和GoF是怎样解决不同情况的耦合问题
- 解决单例设计模式中懒汉式线程安全问题
- 解决VS2008切换设计模式卡死问题
- 解决DesignMode不能正确反应是否处于设计模式的问题
- 设计模式能够解决的问题
- 尝试用AOP解决OOP和设计模式问题(1)
- 尝试用AOP解决OOP和设计模式问题(2)
- 设计模式怎样解决设计问题[笔记]
- 尝试用AOP解决OOP和设计模式问题(2)
- 组合设计模式,解决struts只能有一个资源文件的问题
- Tip:解决DesignMode不能正确反应是否处于设计模式的问题
- >--设计模式怎样解决设计问题
- 设计模式解决的问题
- 解决Eclipse再次打开工程时找不到Design设计模式的问题!...
- 解决Eclipse再次打开工程时找不到Design设计模式的问题!...
- 设计模式的实际应用——在C#中解决单客户端窗口数据并发问题(2010-08-04)
- 设计模式的实际应用——在C#中解决单客户端窗口数据并发问题(2010-08-04)
- 设计模式能够解决的问题
- 设计模式解决的问题
- 基本上,把switch,用设计模式代替,肯定是bug和过度设计。想想,本来修改一个文件几行代码可以解决的问题,变成修改3-6个类才能实现一样的功能。不是傻是什么?