sequence

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.

summary

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

doc


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...


引用和评论

0 条评论