Principles of Object-Oriented Design

Principles of Object-Oriented Design

Principles of Object-Oriented Design

Summarized from [MARTIN] Agile Software Development Principles, Patterns, and Practices. These principles are the hard-won product of decades of experience in software engineering. They are not the product of a single mind, but they represent the integration and writings of a large number of software developers and researchers. Although they are presented here as principles of object-oriented design, they are really special cases of long-standing principles of software engineering.

SRP The Single Responsibility Principle

A class should have only one reason to change.

OCP The Open-Closed Principle

Software entities (classes, packages, methods, etc.) should be open for extension, but closed for modification.

LSP The Liskov Substition Principle

Subtypes must be substitutable for their base types.

DIP The Dependency Inversion Principle

Abstractions should not depend upon details. Details should depend upons abstractions.

ISP The Interface Segregation Principle

Clients shold not be forced to depend upon methods that they do not use. Interfaces belong to clients, not to hierarchies.

REP The Release-Reuse Equivalency Principle

The granule of reuse is the granule of release.

CCP The Common Closure Principle

The classes in a package should be closed together against the same kinds of changes. A change that affects a closed package affects all the classes in that package and no other packages.

CRP The Common Reuse Principle

The classes in a package are reused together. If you reuse one of the classes in a package, you reuse them all.

ADP The Acylcic Dependencies Principle

Allow no cycles in the dependency graph.

SDP The Stable Dependencies Principle

Depend in the direction of stability.

SAP The Stable Abstractions Principle

A package should be as abstract as it is stable.

  
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值