Share via


Package Coupling Principles

Not only the Package Cohesion principles, the Package Coupling principles determine the inter-relationship between the packages that are mostly used. The rules that govern the inter-relationship between packages comes under Package Coupling Principles. 

1. The Acyclic Dependencies Principle

"The dependencies between packages must not form cycles" 

Since packages forms a granule of a release, they also focus manpower. Generally people work in groups when working on a single package and later on when the release is made, all the packages are merged to the main module.  Sometimes, Engineers tend to refer to another package for common resources. When a package is dependent on a package and the package is in turn dependent on the same package again, it is called cyclic dependencies. In other words, say Package  A is dependent on B, and B is somehow dependent on A again, then it is said there exists a cyclic dependencies between A and B. 

2. The Stable Dependencies Principle

"Depend in the direction of stability"

Stability is defined as the amount of changes to be made to a software package when a change is made to the dependent package. The notion of the principle is to support on dependencies in the direction of stability. 

3.  The Stable Abstractions Principle

"Stable packages should be abstract packages" 

A package is said to be stable when any release to the other packages does not modify it. When there is a situation when all the packages pointing to the stable package, the stable package need to be abstract. 

See Also