Communication Between Modules, Cohesion and Coupling
Communication Between Modules, Cohesion and Coupling
• Stamp coupling
– Occurs when one module Module A
passes a non-global data Data structure
structure to another module in
Module B
the form of a parameter
Module coupling
• Data coupling
– Occurs when a
module passes a non- Module A
global data variable to Elementary data item
another module Module B
(similar to stamp
coupling except that
the non-global data
variable is an
elementary data item,
nota data structure)
Module coupling
• Summary of coupling levels
– If the programming language allows
it, try to uncouple each module from
its surroundings by
1. Passing data to a subordinate module in
the form of parameters, rather than
using global data
2. Writing each subordinate module as a
self-contained unit
Summary
• Introduced communication between
modules and parameters.
• Intermodule communication is the flow
of information or data between
modules.
• Passing of parameters was introduced
as a form of intermodule
communication.
Summary
• The differences between formal and
actual parameters and value and
reference parameters was explained.
• Module cohesion and module coupling
must be considered when designing
modular programs.
• Cohesion is a measure of the internal
strength of a module.
• Seven levels of cohesion were
discussed.
Summary
• Coupling is a measure of the extent of
information interchange between
modules.
• Five levels of coupling were discussed.