设计模式——2.策略模式

策略模式(Strategy)

Strategy模式简介:

定义算法家族,并分别封装起来,让它们之间可以互相替换,此模式让算法的变化不会影响到使用算法的客户。

Strategy模式结构:

Strategy

REF

书籍:

设计模式与游戏开发、大话设计模式

GitHub:

https://github.com/me115/design_patterns

原文地址:https://www.cnblogs.com/sylvan/p/9029688.html