Coupling Between Object Classes (CBO)
Overview
Use links between classes define the detailed architecture of the application, just as use links between packages define the highest level architecture. These use links play a determining role in design quality, notably in development and maintenance facilities.
Computation
For a package, this metric provides the average number of classes used per class in the package.
![]()
|
The
... variable |
represents
the … |
|
NumberOfLinks |
number of classes used (associations, use links) for all the package's classes. A class used several times by another class is only counted once. |
|
NumberOfClasses |
number of classes of the package, by recursively processing sub-packages and classes. For the UML modeling project, this variable represents, therefore, the total number of classes of the UML modeling project. |
Nominal range
Between 1 and 4.
Analysis
A value of 0 indicates that a class has no relationship to any other class in the system, and therefore should not be part of the system. A value between 1 and 4 is good, since it indicates that the class is loosely coupled. A number higher than this may indicate that the class if too tightly coupled with other classes in the model, which would complicate testing and modification, and limit the possibilities of re-use. Consider de-coupling this class from the classes to which this class is coupled, and build the class so that it is more independent by providing a more complete set of operations.