Types of Coupling
Coupling measures the strength
of all relationships between functional units
Advantages
· A change in
one module usually does not force a ripple-effect of changes in
other modules.
· Assembly of
modules might require less effort and/or time due to the
decreased inter-module dependency.
· A
particular module might be easier to reuse and/or test because dependent
modules do not need to be
included.
Disadvantages
· A change in
one module usually forces a ripple effect of changes in other
modules.
· Assembly of
modules might require more effort and/or time due to the increased
inter-module dependency.
· A
particular module might be harder to reuse and/or test because dependent
modules must be included.
Contentcoupling(high)
Content coupling is when one
module modifies or relies on the internal workings of
another module (e.g.,
accessing local data of another module). Therefore changing
the way the second module
produces data (location, type, timing) will lead to
changing the dependent
module.
Commoncoupling
Common coupling is when two
modules share the same global data (e.g., a global
variable). Changing the
shared resource implies changing all the modules using it.
Externalcoupling
External coupling occurs
when two modules share an externally imposed data
format, communication
protocol, or device interface.
Controlcoupling
Control coupling is one
module controlling the flow of another, by passing it
information on what to do
(e.g., passing a what-to-do flag). Stamp coupling (Data
structured coupling). Stamp
coupling is when modules share a composite data
structure and use only a
part of it, possibly a different part (e.g., passing a whole
record to a function that
only needs one field of it). This may lead to changing the
way a module reads a record
because a field, which the module doesn't need, has
been modified.
Datacoupling
Data coupling is when
modules share data through, for example, parameters. Each
datum is an elementary
piece, and these are the only data shared (e.g., passing an
integer to a function that computes a square
root).
Comments
Post a Comment