Coupling - This is the degree of interaction between modules; i.e. their inter-relationships
There are also several kinds of coupling, which we rate as follows -:
· Content
· Content
· Common
· Control
· Stamp
· Data
Content Coupling: This occurs when one module directly references the contents of another module. E.g. module x branches to a local label in module y or module x modifies a statement of module y. Such modules are inextricably linked to each other.
- Content coupling is quite dangerous.
Common Coupling: This occurs when several modules have access to the same global data. E.g. use of the C++ modifier public
- Common coupling contradicts the structured programming concept and is quite undesirable
Control Coupling: This occurs when one module has control over the logic of another. If module x calls module y and y determines what action x must take then control coupling is present. The passing of a control switch statement as an argument is an example of control coupling.
Stamp Coupling: This is the case where entire data structures are passed to the called module but only some individual fields are used. E.g. pointer passing in C. Note. Not all the elements in the data structure are acted upon by the called module.
Data Coupling: Two modules are data coupled if all arguments are homogeneous data items. If a data structure is passed then the called module must use all the fields. Data coupling is a desirable goal. Modules which are data coupled are easier to maintain since changes in one is less likely to cause a regression fault in the other.
· Control
· Stamp
· Data
Content Coupling: This occurs when one module directly references the contents of another module. E.g. module x branches to a local label in module y or module x modifies a statement of module y. Such modules are inextricably linked to each other.
- Content coupling is quite dangerous.
Common Coupling: This occurs when several modules have access to the same global data. E.g. use of the C++ modifier public
- Common coupling contradicts the structured programming concept and is quite undesirable
Control Coupling: This occurs when one module has control over the logic of another. If module x calls module y and y determines what action x must take then control coupling is present. The passing of a control switch statement as an argument is an example of control coupling.
Stamp Coupling: This is the case where entire data structures are passed to the called module but only some individual fields are used. E.g. pointer passing in C. Note. Not all the elements in the data structure are acted upon by the called module.
Data Coupling: Two modules are data coupled if all arguments are homogeneous data items. If a data structure is passed then the called module must use all the fields. Data coupling is a desirable goal. Modules which are data coupled are easier to maintain since changes in one is less likely to cause a regression fault in the other.
No comments:
Post a Comment