MCS-014 Unit 6 Modular and Structured Design

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 25

MCS 014 System Analysis And Design

Unit 6
Modular And Structured Design

By Kirit A. D. (MBA, PMP, ITIL, MCTS, SSBB)

Properties Of Design
Modular And Structured Design

Verifiability Traceability Completeness Consistency Efficiency Simplicity

Design Principles
Modular And Structured Design

Problem Partitioning Abstraction Top Down Design Bottom Up 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

Hierarchy of a Structure Chart


Modular And Structured Design
System

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

Reading Structure Chart


Modular And Structured Design
System
MA MA MB

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

MA : Marks A MB : Marks B VMA : Valid MA VMB : Valid MB

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

Goal of Design - Guidelines


System should be divided in to as many relatively independent modules as possible (factoring) Superordinate module should control not more than 7 (thumb rule) subordinate module Dependency level should be as low as possible Usually minimum 50 to maximum 100 lines of code per module
Modular And Structured Design

Coupling Data Coupling


Modular And Structured Design

Prepare Salary (Superordinate)


Salary Details EOF Salary Amount Status

Calculate Salary (Subordinate)

Coupling Stamp Coupling


Modular And Structured Design
Prepare Pay slip
Salary Details Salary Amount
Employee Record

Salary
Employee Record

Formatted Pay Slip

Data Structure

Calculate Total Salary

Format Pay slip

Coupling Control
Modular And Structured Design

Prepare Pay slip

Write Salary is Seven Days Late

Calculate Total Salary

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

Employee Designation Employee Record Employee Name

Find Employee Details

Functionally Cohesion
Modular And Structured Design

Employee Designation

Employee Record

Employee Name

Find Employee Details


Employee Record

Employee Salary

Employee Name

Find Employee Details

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

Nothing common but, kind of cleanup activity

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

You might also like