摘要:
1.定义观察者模式(Observer Pattern)也叫做发布订阅模式(Publish/subscribe),其定义如下:Define a one-to-many dependency between objects so that when one object changes state,al... 阅读全文
posted @ 2015-06-12 15:18
JustYong
阅读(315)
评论(0)
推荐(0)
摘要:
1.为什么要有中介者模式从上图发现这三个类是彼此关联的,每个类都与其他两个类产生了关联关系。修改后的进销存示意图加入了一个中介者作为三个模块的交流核心,每个模块之间不再相互交流,要交流就通过中介者进行。每个模块只负责自己的业务逻辑,不属于自己的则交给中介者进行处理,简化了各个模块之间的耦合关系。2.... 阅读全文
posted @ 2015-06-12 15:18
JustYong
阅读(303)
评论(0)
推荐(0)
摘要:
1.定义Define the sleleton of an algorithm in an operation,deferring some steps to subclasses.Template Method lets subclasses redefine certain steps of a... 阅读全文
posted @ 2015-06-12 14:50
JustYong
阅读(168)
评论(0)
推荐(0)
浙公网安备 33010602011771号