Coupling – Types of coupling


Coupling is the measure of the degree of independence between modules. Two modules that are strongly connected, highly dependent on each other are called highly coupled modules. When two modules have weak interconnection between them then they are loosely coupled modules. Coupling increases with the complexity of the interface.
The priority of coupling from lowest to highest is given in the table below.
Following are the couplings: which are shown here on the basis of their priority and by taking the example of two modules assuming A and B.
There are six types of coupling:
i. Data coupling
ii. Stamp coupling
iii. Control coupling
iv. External coupling
v. Common coupling
vii. Content coupling

Types of coupling:

Data coupling:

  1. Data coupling is when a module passes from a non-global variable to another module.
  2. Modules can only communicate through passing data elements or informational flags.
  3. The two modules have no need to know what goes on inside the other module.

Stamp coupling:

  1. Stamp coupling occurs when a module passes from a non-global data structure or entire structure to another module.
  2. A change in the data structure in one module will affect all modules that use it.
  3. The two modules using stamp coupling must have some knowledge of the internal workings of other modules that use the same data structure.

Control coupling:

  1. Module A and B are said to be controled couple if they communicate bypassing of control information.
  2. The sending module must know a great deal about the inner workings of the receiving module.

External coupling:

  1. A form of coupling in which a module has a dependency to another module, external to the software being developed or to a particular type of hardware.
  2. This is basically related to the communication to external tools and devices.

Common coupling:

  1. In common coupling, both modules A and B share the same data.
  2. With common coupling, it can be difficult to determine which module is responsible for having a set of variables to a particular value.
  3. It is not a good type of coupling because if we want to modify the data then we have to check all modules who are sharing the data.

Content coupling:

  1. Content coupling occurs when one module directly refers to the inner workings of another module.
  2. Modules are highly interdependent to each other. One module can alter data in another module or change a statement coded in another module.

Read more about ISO 9000 Certification