No matter what you work, what you're building, or what language you are programming in, what's the one true constant that will be with you always ? -- CHANGE
Design Principle
- Identify the aspects of your application that vary and separate them from what stays the same. (从应用程序不变的部分中抽离变化的部分,这样可以只对变化的部分进行改进或者扩展,而不会影响其它不变的部分)
- Program to an interface, not an implementation. (借口编程,而非实现编程)
- Favor composition over inheritance. (相对接口,优先选择组成)
OO Basics
- Abstraction
- Encapulation
- Polymorphism
- Inheritance
OO Principles
- Encapsulate what varies
- Favor composition over inheritence
- Program to interfaces, not implementations.
OO Patterns
The Strategy Pattern defines a family of algorithms, encapsulates each one, and make them interchangeable. <br/>Strategy lets the algorithm vary independently from clients that use it.