随笔分类 -  设计模式(Design Pattern)

摘要:意图Attach additional responsibilities to an object dynamically. 为一个对象动态的添加职责.Decorators provide a flexible alternative to subclassing for extending functionality. 对扩展功能来所,包装模式提供了一个比子类话更灵活的替代方式.结构 Component : defines the interface for objects that can have responsibilities added to them dynamically. C 阅读全文
posted @ 2010-08-26 23:42 OYJJ 阅读(2777) 评论(0) 推荐(0)
摘要:意图Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. 在一个操作中定义一个算法的骨架,在子类中改变某些步骤Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure. 模板方法使得子类可以重新定义算法中的某些步骤而保持算法的结构不变结构 AbstractClass : defines abstr 阅读全文
posted @ 2010-08-26 23:11 OYJJ 阅读(415) 评论(0) 推荐(0)
摘要:Java设计模式 Design Pattern:命令模式 Command Pattern目的Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. 将请求封装为一个对象,从而使得客户可以使用不同的参数获得不同的请求,将请求排队或记录请求,并且支持可撤销操作.结构 Command : declares an interface for ex 阅读全文
posted @ 2010-08-22 21:41 OYJJ 阅读(532) 评论(0) 推荐(1)