随笔分类 -  设计模式

每天学习一个设计模式
摘要:定义The Factory Method Pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. 工厂方... 阅读全文
posted @ 2009-04-10 03:27 摇摆的蒜头酥 阅读(195) 评论(0) 推荐(0)
摘要:定义 Decorator Pattern Attaches additional responsibilities to an object dynamically . Decorators provide a flexible alternative to sub classing for extending functionality . 装饰器模式 动态地将责任附加到对象上。若要扩展功能,装... 阅读全文
posted @ 2009-03-23 01:36 摇摆的蒜头酥 阅读(493) 评论(0) 推荐(0)
摘要:定义 The Observer pattern defines a one-to-many dependency between objects so that when one changes state, all of its dependents are notified and updated automatically. 观察者模式定义了对象之间的一对多的依赖关系,这样当一个对象的状态发... 阅读全文
posted @ 2009-03-17 21:02 摇摆的蒜头酥 阅读(437) 评论(0) 推荐(0)
摘要:定义 The Strategy pattern The strategy pattern defines a family of algorithms encapsulate each one, and makes them interchangeable. Strategy lets algorithm vary independently from clients that use i... 阅读全文
posted @ 2009-03-16 15:40 摇摆的蒜头酥 阅读(262) 评论(0) 推荐(0)