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

sequence

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

The Reuse/Release Equivalence Principle (REP)

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. Classes that are modified at the same time and modified for the same purpose are placed in the same component, and classes that are not modified at the same time and are not modified for the same purpose are placed in different components.

For most applications, maintainability is far more important than reusability. If the code in a program has to make some changes, those 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和CCP原则是黏合性原则,它们会让组件变得更大,而CRP原则是排除性原则,它会尽量让组件变小。

doc

Guess you like

Origin juejin.im/post/7083517784130322439