设计模式笔记
绿毛水怪121
这个作者很懒,什么都没留下…
展开
-
适配器模式
模式定义:将一个类的接口转换成用户希望的另一个接口,使得原本由于接口不兼容而不能一起工作的那些类可以一起工作(Convert the interface of a class into another interface clients expect, Lets classes work together that couldn't otherwise because of incompatibl原创 2012-07-05 21:57:38 · 284 阅读 · 0 评论 -
代理模式
模式定义:对其他对象提供一种代理以控制对这个对象的访问(Provide a surrogate or placeholder for another object to control access to it.)。 具体说明:结构型模式。为某个对象提供一个代理对象,并由代理对象持有对源对象的引用。代理就是用一个对象代表另一个对象采取行动。某些情况下,客户不想或者不能够直接访问一个对象,代理可以原创 2012-07-04 23:14:54 · 233 阅读 · 0 评论 -
状态模式
模式定义:允许一个对象在其内部状态改变时改变它的行为。对象看起来似乎修改了它的类。(Allow an object to alter its behavior when its internal state changes. The object will appear to change its class) 具体说明:行为型模式。状态模式将对象的行为用状态类的行为来实现,对对象所有可能出原创 2012-07-04 21:47:46 · 651 阅读 · 0 评论 -
中介者模式
模式定义:用一个中介对象来封装一系列对象的交互。中介者使各对象不需要显式的相互引用,从而松散其耦合度,而且可以独立地改变它们之间的交互(Define an object that encapsulates how a set of objects interact. Promotes loose coupling by keeping objects from referring to each原创 2012-07-05 23:34:55 · 409 阅读 · 0 评论 -
组合模式
模式定义:将对象组合成树形结构以表示“部分-整体”的层次结构。它使得客户对单个对象和对复合对象的使用具有一致性(Compose objects into tree structures to represent part-whole hierarchies. Lets client treat individual objects and compositions of objects unifo原创 2012-07-09 22:02:24 · 260 阅读 · 0 评论