OOP Principle



1.
Encapsulate what varies



2.Code to an interface rather than to an implementation.



3.Each class in your application should has one reason to change.



4.Class are about behavior and functionality.



5.OCP - Open Closed Principle
Classes should be open for extension and closed for modification.



6.DRY - Don't Repeat Yourself
Avoid duplicate code by abstracting out things that things in a single location.



7.SRP - Single Responsibility Principle
Every object in your system should have a single responsibility.



8.LSP - Liskov Substitution Principle
Subtypes must by substitutable for their base types.

posted @ 2007-12-13 16:02  Sink  阅读(242)  评论(0编辑  收藏  举报