摘要:
装饰者模式隐含的是通过一条条装饰链去实现具体对象,每一条装饰链都始于一个Componet对象,每个装饰者对象后面紧跟着另一个装饰者对象,而对象链终于ConcreteComponet对象。 ConcreteComponent:让Decorator对象为自己添加功能。有时候使用ConcreteComponent的派生类提供核心功能,在这种情况就是用ConcreteComponent替代了Component的功能,而且装饰者是继承于ConcreteComponent的子类。 Component:定义ConcreteComponent和Decorator类要实现的方法,简单来说如果一个类继承于该类.. 阅读全文
posted @ 2013-06-28 23:44
未命铭
阅读(266)
评论(2)
推荐(0)

浙公网安备 33010602011771号