文字摘抄来自《Head Frist Design Patterns》,类图绘制参考《Head Frist Design Patterns》。 Design Principle Encapsulate what varies.. Program to an interface, not an implementation. Favor composition over inheritance. Strive for loosely coupled designs between objects that interact. Classes should be open for extension, but closed for modification. Depend upon abstractions. Do not depend upon concrete classes. Principle of Least Knowledge [...]