MCS-014 Unit 6 Modular and Structured Design
MCS-014 Unit 6 Modular and Structured Design
MCS-014 Unit 6 Modular and Structured Design
Unit 6
Modular And Structured Design
Properties Of Design
Modular And Structured Design
Design Principles
Modular And Structured Design
Structure Chart
Modular And Structured Design
Depicts the modular organization of an information system A structure chart graphically shows the way the components of a program or a system are related
Get X
Make Y
Get W
Make X
Symbols
Modular And Structured Design
Data Couples (Data Communication)
Symbol of Module
Module A
Module A
(Superordinate)
Module A
Control Flag (Data Being Communicated) (B & C Called Repeatedly)
Module B
(Subordinate)
Module B
Module C
Symbols
Modular And Structured Design
Module B is Embedded In Module A
Subordinate Modules Are Called On Condition
Module A
Predefined Module
Module A
Module B
R Get Marks B
MB
Get Marks A
Make Result R
Put Result R
MA
MA
VMA
MB
MB
VMB
Read Marks A
Validate Marks A
Read Marks B
Validate Marks B
Modularity
Modular And Structured Design
Modularity is a single attribute of software that allows a program to be intellectually manageable Increases the design clarity Decomposing a system into smaller components that can be coded separately
Goals of Design Coupling Cohesion
Goal of Design
Modular And Structured Design
Design said to be fine only when, read, code and maintained easily. The design of the system should be module based Each module controls the functions of a suitable number of subordinate modules at the next hierarchical level Communication among the module should be kept minimum Keep the size as low as possible The coding of modules should be generic
Salary
Employee Record
Data Structure
Coupling Control
Modular And Structured Design
Coupling Common
Modular And Structured Design
Global data areas are used by the multiple modules A variable can be declared at appropriate level so that it is treated as global variable
Coupling Content
Modular And Structured Design
Used only when non of the discussed are possible Drawback is one module can access the data inside another module and alter it Most of the high level languages dont support content coupling
Cohesion
Modular And Structured Design
The degree to which a module conforms itself to the performance of a single task Module will perform single task which leads to larger degree of portability We can directly plug in the module in an application which requires the performance of this task Since it performs single task, minimum or no need to know the internal function of any other module There are seven types of cohesion Functional Cohesion Sequential Cohesion Communicational Cohesion Procedural Cohesion Temporal Cohesion Logical Cohesion Coincidental Cohesion
Cohesion
Modular And Structured Design
Functional If every instruction in the module is related to a single task The name of the module will usually indicate the task that is performed by it eg. Print Grade Cards, Generate Payslips Sequential Product purchase order->prepare shipping order-> update inventory-> update accounts
Communication Cohesion
Modular And Structured Design
Its like sequential cohesion except the fact that there is not restriction on the sequencing pattern
Employee Service
Functionally Cohesion
Modular And Structured Design
Employee Designation
Employee Record
Employee Name
Employee Salary
Employee Name
Procedural Cohesion
Modular And Structured Design
Any module not functionally cohesive is difficult to maintain Sequence of instruction is important. Sequence cannot be changed arbitrarily E.g.
Pick the course material from MPDD Check the enrolment number on the Hall ticket Attend counseling sessions at study Centre Submit assignments at study Centre
Above example shows, instructions are not related to each other in terms of sequence.
Temporal Cohesion
Modular And Structured Design
Instructions in a module are related to each other only by flow of control and are totally unrelated to their sequence. Eg.
Delete duplicate data from inventory file Reindex inventory file Backup of inventory file
Logical Cohesion
Modular And Structured Design
Instructions in the form of sets Bare minimum relation between various instructions Execution takes place in terms of set of instructions rather than individual instruction Not a good type of cohesion Difficult to maintain logically cohesive module Eg.
Study in home Study in library Study in garden
Coincidental Cohesion
Modular And Structured Design
No relationship between the instructions This is worse type of cohesion among the discussed
Questions ?
Thank You