Concept:
In software design, "Coupling" refers to the strength of the relationship between different modules. While Cohesion should be high (internal strength), Coupling should be Low (external independence). Low coupling means that changes in one module are unlikely to require changes in another.
Step 1: Understanding the Coupling Hierarchy.
Coupling is categorized from worst (highest/tightest) to best (lowest/loosest):
• Content Coupling (Worst): One module modifies the internal data or code of another.
• Common Coupling: Multiple modules share the same global data area.
• Control Coupling: One module passes "control information" (like a flag) to tell another module what to do.
• Stamp Coupling: Modules share a composite data structure but only use parts of it.
• Data Coupling (Best): Modules share only necessary data items through simple parameters.
Step 2: Why Data Coupling is Desirable.
In data coupling, modules communicate via a well-defined interface, passing only the specific data needed for a function (e.g., passing an integer to a square-root function). The internal logic of how the function works is completely hidden. This supports the principle of "Information Hiding" and "Encapsulation."
Step 3: Impact on Maintenance.
Loose coupling (like Data Coupling) makes a system easier to maintain, test, and reuse. If you decide to change the internal algorithm of a data-coupled module, you do not have to worry about breaking the rest of the system, provided the parameter list remains the same.