随笔分类 - 设计模式
每天学习一个设计模式
摘要:定义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. 工厂方...
阅读全文
摘要:定义 Decorator Pattern Attaches additional responsibilities to an object dynamically . Decorators provide a flexible alternative to sub classing for extending functionality . 装饰器模式 动态地将责任附加到对象上。若要扩展功能,装...
阅读全文
摘要:定义 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. 观察者模式定义了对象之间的一对多的依赖关系,这样当一个对象的状态发...
阅读全文
摘要:定义 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...
阅读全文

浙公网安备 33010602011771号