您的位置:首页 > 其它

OO设计原则

2011-03-10 10:14 375 查看
开闭原则(open/close principle, OCP): Open on extensibility , close on modification. We should use interface to encapsulation, use abstract mechanism, and use polymorphism.

Liskov替换原则(Liskov Substitution Principle, LSP),

依赖倒置原则(Dependency Inversion Principle, DIP) depend on interface, instead of concrete class.

接口分离原则(Interface Segregation Principle,ISP): one class given to more clients to use, create each interface for every client, and then this class implement all interfaces.

单一职责原则(Single Responsibility Principle, SRP).

l

l

An excellent system should have these following characteristics:

friendly, understandibility, reliability, reusability, extensibility, portalibity, scalability, simplicity.

Some characteristics conflict, we should make our choice by priority.

But simplicity should be concerned first so that the implementation, use and maintain for the system become simple,

In the end, lower develop cost and shorten develop time.

Attachment: OODesignPrinciples.ppt.zip
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: