Afferent/Efferent Coupling

The terms “afferent coupling” and “efferent coupling” are used to denote the direction of cross-component dependencies:

Dependencies’ Directions in Balanced Coupling

The balanced coupling model uses the terms upstream and downstream components to denote the direction of the flow of knowledge. Knowledge flows in the opposite direction of dependencies: when referencing an external component, you must first acquire knowledge of how to integrate with it–meaning knowledge flows from upstream to downstream components.

Downstream ComponentUpstream ComponentDependencyKnowledge Flow

Therefore, in the balanced coupling model, efferent coupling is akin to the number of upstream components a downstream component has, and afferent coupling is the number of consumers an upstream component has.

Software Package Metrics

The concepts of afferent and efferent coupling are primarily used for calculating the following design metrics:

While these metrics are easy to calculate, their practical application is limited. Focusing solely on the number of relationships misses the essence of each dependency and its effect on system design.

Consider a component with one external dependency (efferent coupling) and 100 components depending on it (afferent coupling). The component’s instability score is extremely low: I = Ce / (Ce + Ca) = 1 / (1 + 100) = 0.0099, suggesting it is very stable. However, assume that the outgoing dependency has high integration strength–intrusive coupling–while the incoming dependencies have low integration strength–contract coupling.

As a result, the single outgoing dependency has the potential to drive significantly more cascading changes than 100 dependencies with low integration strengths.


Learn More