Coupling of Modules in Software Development

The degree of dependency, interaction, or reciprocal interdependence between two modules, classes, or components is measured by the coupling between them. A module is considered to be functioning independently of other modules if it has strong cohesion and low coupling.

When callbacks to functions between two modules contain a significant amount of common data and interaction happens via shared data, the two modules in question are said to be heavily linked.

It will be possible to quantitatively evaluate the degree of connection between two modules with the assistance of a classification of the various forms of coupling. Any two modules may couple in one of five ways.

Data coupling is when two modules connect by utilizing a basic data type, such as an integer, float, character, etc. One example is sending any float value through a function that computes the square root. This data point should be utilized for problem-related purposes only and not for control purposes.

Two modules are highly interconnected if they exchange a lot of data. The complexity of two modules’ interfaces determines how closely they are coupled. Based on the parameter, number of parameters, etc., the user interface complexity is calculated. Better is a module with little coupling.

When two modules interact via a composite data item, such as an item of data in PASCAL or a structure in C, they are said to be “stamped coupled.”

Control coupling: When data collected from a particular module is utilized to control the execution of instructions in another module, there is control coupling between the two modules. A flag that is set in one component and tested within another is an example of controller coupling.

coupling modules dependency

Common coupling: When two modules communicate data via certain global data items, they are said to be common linked. Additionally called global coupling. Sharing a global variable is an example. Modifications to a global variable affect all modules.

Pathological coupling is another name for content coupling. If two modules exchange code, such as when they branch into one another or when one modifies how another module functions internally (by, for example, accessing local data in another module), that is when there is content coupling between the two modules.

When modules cannot interact with one another, there is no coupling.

Data coupling has a lower degree of interdependence, coordination, and data flow than content coupling, which has a higher degree of interdependence, coordination, and information flow.

The drawbacks of high coupling between modules include difficulty in understanding and maintaining design solutions, an increase in development effort, difficulty in reusing and testing specific modules, increased effort in module assembly, and difficulty in developing modules independently. When compared to high coupling, high cohesiveness somehow connects to loose connectivity and vice versa.

Module coupling between modules

3/5 - (1 vote)
Share:

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *