摘要: 装饰模式定义:Attach additional responsibilities to an object dynamically keeping the same interface. Decoators provide a flexible alternative to subclassing for extending functionality.动态地给一个对象添加一些额外的职责。就增加功能来说,装饰模式相比生成子类更为灵活。 如上图所示(截取自《Head First Design Patterns 阅读全文
posted @ 2012-12-30 00:49 叶梅树 阅读(4617) 评论(7) 推荐(3) 编辑