Head First Design Pattern - 1 - Design Principle
所有的design pattern都是遵循一些design
principle的,这些design principle的不同组合造就了不同的design pattern。所以,要掌握design
pattern,就要熟悉这些design principle,并能自如的组合它们。
Design Principle:(不断更新中)
1. Identify the aspects of your application that vary and separate them from what stays the same.
2. Program to an interface, not an implementation.
3. Favor composition over inheritance.
4. Strive for loosely coupled designs between objects that interact.
5. Classes should be open for extension, but closed for modification.
6. Depand upon abstraction. Do not depend upon concrete classes.
Design Principle:(不断更新中)
1. Identify the aspects of your application that vary and separate them from what stays the same.
2. Program to an interface, not an implementation.
3. Favor composition over inheritance.
4. Strive for loosely coupled designs between objects that interact.
5. Classes should be open for extension, but closed for modification.
6. Depand upon abstraction. Do not depend upon concrete classes.