The degree of interconnectedness between modules is described by _.

The Design phase in the Software Development Life Cycle plays a pivotal role in creating a solution for the problems outlined in the Software Requirement Specification (SRS) document. Its primary output is the Software Design Document (SDD). To measure the quality of a software system’s design, two key concepts, coupling and cohesion, are essential. In this comprehensive guide, we will delve into the degree of interconnectedness between modules, as described by coupling and cohesion.

Coupling: Interdependence Between Modules

Coupling refers to the degree of interdependence between software modules. High coupling signifies that modules are closely connected, and changes in one module may have a significant impact on other modules. In contrast, low coupling means that modules are independent, and changes in one module have minimal influence on other modules.

You Might Like This :

Types of Coupling:

  1. Data Coupling: Modules communicate by passing data. Changes in one module don’t affect the others. An example is a customer billing system.
  2. Stamp Coupling: The complete data structure is passed from one module to another. This may involve tramp data and is chosen for efficiency.
  3. Control Coupling: Modules communicate by passing control information, which can be either good or bad based on the context.
  4. External Coupling: Modules depend on other modules external to the software, like protocols or device formats.
  5. Common Coupling: Modules share global data structures, making changes in global data impact multiple modules.
  6. Content Coupling: One module can modify the data of another module or pass control flow, which is undesirable.
  7. Temporal Coupling: Modules depend on the timing or order of events, which can result in design issues.
  8. Sequential Coupling: The output of one module serves as the input for another, creating a chain of dependencies, which can be challenging to maintain.
  9. Communicational Coupling: Modules share a common communication mechanism, which can lead to performance issues.
  10. Functional Coupling: Modules depend on each other’s functionality, resulting in tightly-coupled code.
  11. Data-Structured Coupling: Modules share a common data structure, which can lead to data integrity issues.
  12. Interaction Coupling: Methods of a class invoke methods of other classes, with the worst form being direct access to internal parts.
  13. Component Coupling: Classes have variables or methods with parameters of another class, creating interaction coupling.

Cohesion: Functional Relatedness Within a Module

Cohesion measures the degree to which elements within a module are functionally related. High cohesion means that all elements within a module work together to fulfill a single, well-defined purpose.

Types of Cohesion:

  1. Functional Cohesion: Every essential element for a single computation is contained in the component.
  2. Sequential Cohesion: Elements exchange data, naturally occurring in functional programming languages.
  3. Communicational Cohesion: Elements operate on the same input or contribute to the same output data.
  4. Procedural Cohesion: Elements ensure the order of execution but may not be reusable.
  5. Temporal Cohesion: Elements are related by timing involved, with all tasks executed in the same time span.
  6. Logical Cohhesion: Elements are logically related but not functional.
  7. Coincidental Cohesion: Elements are unrelated, the worst form of cohesion.
  8. Procedural Cohesion (again): Elements or tasks are grouped based on their sequence of execution, common in structured programming languages.
  9. Communicational Cohesion (again): Elements or tasks are grouped based on their interactions with each other, found in object-oriented programming.
  10. Temporal Cohesion (again): Elements or tasks are grouped based on their timing, common in real-time and embedded systems.
  11. Informational Cohesion: Elements or tasks are grouped based on their relationship to specific data structures or objects, common in object-oriented programming.
  12. Functional Cohesion (again): All elements contribute to a single well-defined function or purpose.
  13. Layer Cohesion: Elements are grouped based on their level of abstraction or responsibility.

Advantages of Low Coupling:

  • Improved maintainability.
  • Enhanced modularity.
  • Better scalability.

Advantages of High Cohesion:

  • Improved readability and understandability.
  • Better error isolation.
  • Improved reliability.

Disadvantages of High Coupling:

  • Increased complexity.
  • Reduced flexibility.
  • Decreased modularity.

Disadvantages of Low Cohesion:

  • Increased code duplication.
  • Reduced functionality.
  • Difficulty in understanding the module.

Conclusion

In the world of software design, understanding the concepts of coupling and cohesion is crucial. High coupling and low cohesion can lead to challenging software systems, making them difficult to change and test. Conversely, low coupling and high cohesion make a system more maintainable and scalable. Recognizing the different types of coupling and cohesion and their advantages and disadvantages is vital for creating well-designed, efficient software systems.

Whether you’re a budding software engineer or a seasoned developer, the significance of coupling and cohesion cannot be overstated. These concepts are fundamental in ensuring the quality and robustness of your software. So, embrace them, apply them, and elevate your software design skills to new heights.

Bipul author of nerdy tutorial
Bipul

Hello my name is Bipul, I love write solution about programming languages.

Articles: 146

Leave a Reply

Your email address will not be published. Required fields are marked *