Intermodule Coupling



Coupling is the measure of the interdependence of one module to another. Modules should have low coupling. Low coupling minimizes the "ripple effect" where changes in one module cause errors in other modules.




No Direct Coupling

These are independent modules and so are not really components of a single system.



Data Coupling

Two modules are data coupled if they communicate by passing parameters. This has been told to you as a "good design principle" since day one of your programming instruction.
Diagram



Stamp Coupling

Two modules are stamp coupled if they communicate via a passed data structure that contains more information than necessary for them to perform their functions.
Diagram



Control Coupling

Two modules are control coupled if they communicate using at least one "control flag".
Diagram



Common Coupling

Two modules are common coupled if they both share the same global data area. Another design principle you have been taught since day one: don't use global data.
Diagram



Content Coupling

Two modules are content coupled if:
  1. one module changes a statement in another (Lisp was famous for this ability)
  2. one module references or alters data contained inside another module
  3. one module branches into another module

Examples