0% found this document useful (0 votes)
5 views

Coupling and coheshion

The document discusses cohesion and coupling in software design, emphasizing the importance of module responsibilities and dependencies. It outlines the types of cohesion, ranked from functional to coincidental, and the types of coupling, ranked from content to data. High cohesion and low coupling are highlighted as beneficial for maintainability, readability, and modularity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Coupling and coheshion

The document discusses cohesion and coupling in software design, emphasizing the importance of module responsibilities and dependencies. It outlines the types of cohesion, ranked from functional to coincidental, and the types of coupling, ranked from content to data. High cohesion and low coupling are highlighted as beneficial for maintainability, readability, and modularity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

---

1. Cohesion

Cohesion refers to how closely related and focused the responsibilities of a module (or
class) are. A highly cohesive module performs a single, well-defined task, making it easier to
maintain and reuse.

Types of Cohesion (Best to Worst)

1. Functional Cohesion – All parts of the module work together to perform a single function.

2. Sequential Cohesion – The output of one part of the module is used as input for another
part.

3. Communicational Cohesion – All parts operate on the same data or contribute to the
same output.

4. Procedural Cohesion – The parts execute in a specific order but are weakly related.

5. Temporal Cohesion – Elements are grouped because they are executed at the same time
(e.g., initialization).

6. Logical Cohesion – Elements perform similar activities but are executed based on a
control flag.

7. Coincidental Cohesion – No logical relationship between elements; grouped arbitrarily


(worst type).

High Cohesion Benefits

Easier to maintain and modify.

Better code readability.

Easier to reuse modules.


---

2. Coupling

Coupling refers to the level of dependency between modules. Lower coupling means fewer
dependencies, making the system more modular and maintainable.

Types of Coupling (Worst to Best)

1. Content Coupling – One module modifies another module's internal data (worst type).

2. Common Coupling – Modules share global variables.

3. External Coupling – Dependence on external systems (e.g., file formats, protocols).

4. Control Coupling – One module controls another’s flow via flags or switches.

5. Stamp Coupling – Modules share structured data (objects, records) but don’t need all
fields.

6. Data Coupling – Modules share only necessary data through parameters (best type).

Low Coupling Benefits

Easier to test and debug.

Improves modularity and reusability.

Reduces the impact of changes in one module on others.

You might also like