Control Coupling - ✔️✔️• When one module passes parameters or a return code to
control the behavior of another module
• It is impossible for the controlled module to function without some direction from the
controlling module
Types of Coupling - ✔️✔️• Content coupling
• Common coupling
• Control coupling
• Stamp coupling
• Data coupling
Design Principles - ✔️✔️are guidelines for decomposing a system's required
functionality and behavior into modules
6 Common Design Principles - ✔️✔️- Modularity
- Interfaces
- Information hiding
- Incremental development
- Abstraction
- Generality
Modularity - Design Principle - ✔️✔️is the principle of keeping separate the various
unrelated
aspects of a system, so that each aspect can be studied in isolation (also called
separation of concerns)
Tightly coupled - ✔️✔️they depend a great deal on each other
Loosely coupled - ✔️✔️modules have some dependence, but their interconnections
are weak
Uncoupled - ✔️✔️modules have no interconnections at all; they are completely
unrelated
Refactoring - ✔️✔️• Design decisions are periodically revisited and revised
• Objective: to simplify complicated solutions or to optimize the design
• Also used to address changing requirements
Ways modules are dependent on each other - ✔️✔️- The references made from one
module to another
- The amount of data passed from one module to another
, - The amount of control that one module has over the other
Content Coupling - ✔️✔️Occurs when one component modifies an internal data item in
another component, or when one component branches into
the middle of another component
Common Coupling - ✔️✔️Making a change to the common data means tracing back to
all components that access those data to evaluate the effect of
the change
Stamp Coupling - ✔️✔️occurs when complex data structures are passed between
modules
- represents a more complex interface between modules, because the modules have to
agree on the data's format and organization
Data Coupling - ✔️✔️If only data values, and not structured data, are passed
- simpler and less likely to be affected by changes in data representation
Cohesion - ✔️✔️refers to the dependence within and among a module's internal
elements (e.g., data, functions, internal modules)
Coincidental Cohesion - ✔️✔️(worst degree)
- Parts are unrelated to one another
Logical Cohesion - ✔️✔️Parts are related only by the logic structure of code
Temporal Cohesion - ✔️✔️Module's data and functions related because they are used
at the same time in an execution
Procedural Cohesion - ✔️✔️Similar to temporal, and functions pertain to some related
action or purpose
Communication Cohesion - ✔️✔️Operates on the same data set
Function Cohesion - ✔️✔️(ideal degree)
- All elements essential to a single function are contained in one module, and all of the
elements are essential to the performance of the function