OO Principles

Encapsulates what varies.

Favor composition over inheritance.

Program to interfaces, not implementation.

Classes should be open for extension, but closed for modification.

Depend upon abstractions. Do not depend upon concrete classes.

Principle of LeastKnowledge - talk only to your immediate friends.

Strive for loosely coupled designs between objects that interact.

 

Don't call us, we will call you.


A class should have only one reason to change.

posted @ 2007-07-17 16:02  南守拥  阅读(380)  评论(2编辑  收藏  举报