The Strategy Pattern

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.