1. Program to an interface and not to an implementation.
针对接口编程,不针对实现编程。
2. Favor object composition over inheritance.
多用组合少用继承。
3.Find the changable(or maybe changable) things in application, and separate them from unchangable parts.
找出应用中可能需要变化之处, 把它们独立出来, 不要和那些不需要变化的代码混在一起.
4. Design for loose coupling between objects
为了交户对象之间的松耦合设计而努力.
松耦合的设计之所以让我们建立有弹性的OO系统,能够应对变化,是因为对象之间的互相依赖降到了最低。
5.Design should open to extension, close to revision.
类应该对扩展开放,对修改关闭。
6.Depending on abstraction, not implementation.
依赖抽象,不要依赖具体类。
7.only talk to friends.
只和朋友交谈。
8.don't call me, I will call u.
别找我,我会找你。
9.there should be only one reason that u change the same class.
类应该只有一个被改变的理由。