tags:

views:

644

answers:

1

What is the Reuse/Release Equivalence Principle and why is it important?

+3  A: 

The Reuse/Release Equivalence Principle (REP) says:

The unit of reuse is the unit of release. Effective reuse requires tracking of releases from a change control system. The package is the effective unit of reuse and release.

The unit of reuse is the unit of release

Code should not be reused by copying it from one class and pasting it into another. If the original author fixes any bugs in the code, or adds any features, you will not automatically get the benefit. You will have to find out what's changed, then alter your copy. Your code and the original code will gradually diverge.

Instead, code should be reused by including a released library in your code. The original author retains responsibility for maintaining it; you should not even need to see the source code.

Effective reuse requires tracking of releases from a change control system

The author of a library needs to identify releases with numbers or names of some sort. This allows users of the library to identify different versions. This requires the use of some kind of release tracking system.

The package is the effective unit of reuse and release

It might be possible to use a class as the unit of reuse and release, however there are so many classes in a typical application, it would be burdensome for the release tracking system to keep track of them all. A larger-scale entity is required, and the package fits this need well.

See also Robert Martin's article on Granularity.

Phillip Wells