Design Principles:

  • Identify the aspets of your application that vary and seperate them from what stays the same.
    Take what varies and "Ecapsulate" it so it won't affect the rest of your code.
  • Program to an interface, not an implementation.
  • Favor composition over inheritance.
    The picture followed is The Strategy Pattern:
  • Head First Design Patterns(读书笔记)

相关文章: