摘要: ★★★★★ 定义一个操作中的算法的骨架,而将一些步骤延迟到子类中。Template Method使得子类可以不改变一个算法的结构即可重定义该算法的某些特定步骤。 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. 阅读全文
posted @ 2007-09-25 16:07 sekihin 阅读(498) 评论(0) 推荐(0) 编辑
摘要: ★★★★☆ 定义一系列算法,把它们一个一个封装起来,并且使它们可互相转换。该模式使得算法可独立于使用它的客户而变化。 Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. 阅读全文
posted @ 2007-09-25 15:52 sekihin 阅读(508) 评论(0) 推荐(0) 编辑
摘要: ★★★☆☆ 允许一个对象在其内部状态改变时改变它的行为。从而使对象看起来似乎修改了其行为。 Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. 阅读全文
posted @ 2007-09-25 08:53 sekihin 阅读(449) 评论(0) 推荐(0) 编辑