design pattern notes [5] - template method
2012-12-20 23:23
441 查看
Template method lets abstract base class (this is the class
to implement the algorithm) to implement invariant algorithm. The subclasses can redefine the algorithm when necessary. By this mechanism, we can reuse the code.
Normally, factory method is used by template to get instance of concrete subclass. Compared with template method, strategy uses delegation to vary the algorithm.
to implement the algorithm) to implement invariant algorithm. The subclasses can redefine the algorithm when necessary. By this mechanism, we can reuse the code.
Normally, factory method is used by template to get instance of concrete subclass. Compared with template method, strategy uses delegation to vary the algorithm.
相关文章推荐
- design pattern notes [5] - template method
- Head First Design Patterns 阅读笔记之八: the Template Method Pattern
- [Design] Template Method Pattern
- Template Method Design Pattern - 模板方法设计模式
- Head First Design Patterns - Template Method Pattern
- Template Method Design Pattern in Java
- Template Method Pattern(Gof-Behavioral Design Pattern)
- Design Pattern Template Method
- head first--------------------template method pattern
- 二十五.行为型设计模式——Template Method Pattern(模版方法模式)
- Asp.Net Design Pattern Studynotes -- Part1
- Template Method Pattern 模版方法模式
- 如何让孩子爱上设计模式 ——24.模板方法模式(Template Method Pattern)
- [导入]Factory Method Design Pattern
- Template Method Pattern
- design pattern notes [7] - state,strategy,memento,mediator,and iterator
- 第 9 章 模板方法模式【Template Method Pattern】
- 9. The template Method Pattern
- 模板方法模式 template method pattern
- 模板方法模式(Template Method Pattern)