Reuse release equivalence principle

From CSSEMediaWiki
Jump to: navigation, search

The Reuse/Release Equivalency Principle is:

The granule of reuse is the granule of release. Only components that are released through a tracking system can be effectively reused. This granule is the package.

What is reuse? Copying code is not reuse. If you copy or insert code/modules in to your code then you own the code. If it doesn't do what you like you have to change it. If there are bugs you have to fix them and most of all it is you who has to maintain it.

"I reuse code if, and only if, I never have to look at the source code." ... "Thus i can reuse nothing that is not also released." Robert Cecil Martin 1996b

Package is used as the unit of distributing a software system. When one of the components in the software system want to be reused in other applications, then package is the concrete unit that should be used.

A package provides a set of functions required by the design contract. Hence it is treated as a functional unit. If other application needs such a function sets, then the package is put into place to serve the functionalities required by design.

Why not use the class as the functional unit? Classes are considered too small if proper OO principles are used in a design. A set of functionalities are always provided by more than one class. In this case, the emphasis is “functional unit” rather than physical code unit, hence package is commonly the better candidate both in theory and in practice.

More information can be found in Robert C Martin's book: Agile Software Development, Principles, Patterns, and Practices (2003) published by Pearson. (,,0135974445,00%2Ben-USS_01DBC.html)

Personal tools