Talk about the REP, CCP, CRP principles of software development


This paper mainly studies the principles of REP, CCP and CRP in software development

The Reuse/Release Equivalence Principle (REP)

Reuse/Publish Equivalence Principle
The granular of reuse is the granular of release.
The minimum granularity of software reuse should be equal to the minimum granularity of its release, and it needs to have its own release version number.

The Common Closure Principle (CCP)

The Common Closure Principle, the Single Responsibility Principle at the Component Level
The classes in a component should be closed together against the same kinds of changes. A change that affects a component affects all the classes in that component and no other components.
We should put classes that are modified at the same time and for the same purpose into the same component, and classes that are not modified at the same time and are not modified for the same purpose into different components.

For most applications, maintainability is far more important than reusability. If the code in a program must make some changes, then these changes are best reflected in the same component, rather than distributed in many components. Because if these changes are concentrated in the same component, we only need to redeploy that component, other components do not need to be revalidated and redeployed

The Common Reuse Principle (CRP)

Common reuse principle
The classes in a component are reused together. If you reuse one of the classes in a component, you reuse them all.
Don't force users of a component to depend on things they don't need. It is recommended that we place frequently reused classes and modules in the same component.


REP and CCP principles are cohesive principles that make components bigger, while CRP principles are exclusionary principles that try to make components smaller.


spring boot , docker and so on 欢迎关注微信公众号: geek_luandun


11.8k 声望
2k 粉丝
0 条评论


11.8k 声望
2k 粉丝