Page 140 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 140
Principles of Software Engineering
Notes
Figure 6.4: Types of Coupling
Content Common Control Stamp Data
Tight Loose
More interdependency Less interdependency
More coordination Less coordination
More information flow Less information flow
Control Coupling: 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 that the module does not need has been modified.
Data Coupling: 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).
Message Coupling (low): This is the loosest type of coupling. It can be achieved by state
decentralization (as in objects) and component communication is done via parameters or message
passing (see Message passing).
No Coupling: Modules do not communicate at all with one another. Conceptual model of
Coupling. Coupling can be “low” (also “loose” and “weak”) or “high” (also “tight” and “strong”).
Some types of coupling, in order of highest to lowest coupling, are as follows. (See Figure 6.5)
Figure 6.5: Show the Range of Coupling
134 LOVELY PROFESSIONAL UNIVERSITY