Design Principle:

  • Identify the aspects of your application that vary and sparate them from what stays the same.
  • Program to an interface, not an implementation.
  • Favor composition over inheritance

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable.

Strategy lets the algorithm vary independently from clients that use it.

Head First Design Patterns - Strategy Pattern

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-06-24
  • 2021-05-20
  • 2021-10-26
  • 2021-09-13
猜你喜欢
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案