摘要:
★★★★☆
定义一系列算法,把它们一个一个封装起来,并且使它们可互相转换。该模式使得算法可独立于使用它的客户而变化。
Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. 阅读全文
摘要:
★★★☆☆
允许一个对象在其内部状态改变时改变它的行为。从而使对象看起来似乎修改了其行为。
Allow an object to alter its behavior when its internal state changes. The object will appear to change its class. 阅读全文