1 / 18

Module Structure in Software Design: Coupling and Cohesion

This article discusses the importance of module structure in software design, specifically focusing on coupling and cohesion. It explains the different types of coupling and levels/types of cohesion, and highlights the relationship between cohesion and coupling. The article also introduces the concept of functional-oriented design and discusses the use of structure charts and pseudocode in system design.

Download Presentation

Module Structure in Software Design: Coupling and Cohesion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design • Module view • What module should the system and which have to be developed . • It determines the module structure of components.

  2. Coupling • It is the measure of the degree of interdependence between modules. • Coupling between the modules is the strength of interconnection between modules or a measure of interdependence among modules. • Highly coupled – strong interconnection • Loosely coupled- weak interconnection

  3. Factors Affecting Coupling • Number of interfaces increases coupling. • Complexity of interface • Type of info flow along interfaces • Data • control

  4. Types of coupling • Data coupling: The dependency b/w module A and B is said to be data coupled if their dependency is based on the fact they communicate by only passing of data. • Stamp Coupling: When complete data structure is passed from one module to another. • Control Coupling: Passing of control information. This is set by flags that are set by one module and reacted upon by the dependent module.

  5. External coupling: Related to the communication external tools and devices. • Common Coupling: Module A and B have share data. • Content Coupling: Module A changes data of module B. A B C D

  6. Cohesion • Cohesion is a measure of a degree to which the elements of a module are functionally related. • Cohesion of the module represents how tightly bound the internal elements of the module are to one another

  7. Levels / Types of cohesion • Coincidental: X and Y here no conceptual relation ship other than shared code. • Logical: X and Y performs logically similar operations. • Temporal : Tasks that are related by the fact that all tasks must be executed in the same time span.

  8. Procedural: Procedural cohesion occurs in modules whose instructions although accomplish different tasks yet have been combined because there is a specific order in which the tasks are to be completed. • Communicational: X and Y both operate on same input/ output data. • Sequential: X outputs some data which forms input to Y. • Functional: X and Y are a part of single functional task. Related to performing single function.

  9. Functional oriented design • The design process for software systems often has two levels. • At first level the focus is on deciding which modules are needed for the system, their specification of these modules, and the modules should be interconnected. • Design is imposed on a set of interacting units where each unit has clearly defined functions.

  10. This method works fine for small programs. • While(not finished) • { • Read an expression; • Evaluate the expression; • Print the value; • }

  11. Print module • Print (expression exp) • { • Switch(exp->type) • Case integer • Print integer; • Case real • Print real; • }

  12. Top down structure

  13. Functional oriented design are represented as • DFD • Data Dictionary • Structure chart • Pseudo code Structure chart is one of the most commonly used method for system design. Black boxes are used.

  14. Data • Control • Module • Conditional call of module

  15. Pseudocode • Using Pseudocode, the designer describes system characteristics using short concise , english language phrases that are structured by keywords such as If then Else, Do while, end .

  16. Relation Ship b/w cohesion and Coupling • A s/w engg must design the modules with goal of high cohesion and low coupling.

More Related