.NET 下运用策略模式(组合行为和实体的一种模式)
2017-02-06
25
我简单的理解策略模式就是把行为(方法)单独的抽象出来,并采用组合(Has-a)的方式,来组合行为和实体的一种模式。再来个官方的解释: Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. 网上也有很多...