Monday, July 31, 2017

Principles of package design

The Reuse-Release Equivalence Principle (REP)
The granule of reuse is the granule of release.

The Common-Reuse Principle (CRP)
The classes in a package are reused together. If you reuse one of the classes in a package, you reuse them all.

The Common-Closure Principle (CCP)
The classes in a package should be closed together against the same kinds of changes. A change that affects a package affects all the classes in that package and no other packages.

The Acyclic-Dependencies Principle (ADP)
Allow no cycles in the package-dependency graph.

The Stable-Dependencies Principle (SDP)
Depend in the direction of stability.

The Stable-Abstractions Principle (SAP)
A package should be as abstract as it is stable.

Robert C. Martin, "Principles of Package Design", in Agile Software Development: Principles, Patterns, and Practices, 253-268.

See also the pages about these principles in the WikiWikiWeb.

No comments

Post a Comment