Explain Coupling

Coupling is an indication of the relative interdependence among modules. Coupling is a measure that defines the level of inter-dependability among modules of a program. It tells at what level the modules interfere and interact with each other. The lower the coupling, the better the program

There are five levels of coupling,they are-

  •  Content coupling – When a module can directly access or modify or refer to the content of another module, it is called content level coupling.
  •  Common coupling– When multiple modules have read and write access to some global data, it is called common or global coupling.
  • Control coupling– Two modules are called control-coupled if one of them decides the function of the other module or changes its flow of execution.
  • Stamp coupling– When multiple modules share common data structure and work on different part of it, it is called stamp coupling.
  •  Data coupling– Data coupling is when two modules interact with each other by means of passing data (as parameter). If a module passes data structure as parameter, then the receiving module should use all its components.

Ideally, no coupling is considered to be the best.

Leave a Reply