最新消息:

The Strategy Pattern

读书学习 hamo 1034浏览 0评论

The Strategy Pattern defines a family of algorithms, encapsulates each once, and makes them interchangebale. Strategy lets the algorithm vary independently from clients that use it.

OO Principles:

  • Encapsulate what varies.
  • Favor compostion ove inheritence.
  • Program to interface, not implementation.

Bullet Points:

  • Knowing the OO basics does not make you a great OO designer.
  • Good OO designs are reusable, extensible and maitainable.
  • Patterns are proven object-oriented experience.
  • Patterns don’t give you code, the give you general solution to design problems. You apply them to your specific application.
  • Patterns aren’t invented, they are discovered.
  • Most patterns and principles address issues of change in software.
  • Most patterns allow some part of system to vary independently of all other parts.
  • We often try to take what varies in a system and encapsulate it.
  • Pattens provide a shared language that can maximize the value of your communication with other developers.

转载请注明:哈默博客 » The Strategy Pattern

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址