SlideShare a Scribd company logo
MODULE:VMODULE:V
SOFTWARE DESIGNSOFTWARE DESIGN
Namita PandaNamita Panda
School of Computer EngineeringSchool of Computer Engineering
KIIT Deemed to be UniversityKIIT Deemed to be University
01/25/1901/25/19 11MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN
Software Design
 Design phase transformsDesign phase transforms SRS documentSRS document intointo
thethe design documentdesign document..
 TheThe design documentdesign document produced at the end ofproduced at the end of
the design phase should bethe design phase should be implementableimplementable
using a programming languageusing a programming language in the codingin the coding
phase.phase.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 22
Software Design
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 33
Items Designed During Design PhaseItems Designed During Design Phase
 DifferentDifferent modulesmodules
 Control relationshipControl relationship (call/invocation(call/invocation
relationship) among modulesrelationship) among modules
 Interface among moduleInterface among modules(data itemss(data items
exchanged among different modules)exchanged among different modules)
 Data structureData structure of individual modulesof individual modules
 Algorithm requiredAlgorithm required to implement individualto implement individual
module.module.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 44
Software DesignSoftware Design
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 55
Software DesignSoftware Design
 A module consists of:A module consists of:
--several functions--several functions
--associated data structures.--associated data structures.
AA High Level DesignHigh Level Design identify…identify…
 ModulesModules
 control relationships among modulescontrol relationships among modules
 interfaces among modules.interfaces among modules.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 66
Software DesignSoftware Design
 Several notations are available to representSeveral notations are available to represent
high-level design:high-level design:
 Usually a tree-like diagram calledUsually a tree-like diagram called structurestructure
chartchart is used.is used.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 77
Software DesignSoftware Design
 Detailed designDetailed design
For each module, design:For each module, design:
--data structure--data structure
--algorithms--algorithms
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 88
Attributes of a good software designAttributes of a good software design
 CorrectnessCorrectness
 Should correctly implement all the functionalities ofShould correctly implement all the functionalities of
the system.the system.
 UnderstandabilityUnderstandability
 Easily understandableEasily understandable
 EfficiencyEfficiency
-- A good design solution should adequately address-- A good design solution should adequately address
resource ,time and cost optimization issues.resource ,time and cost optimization issues.
 MaintainabilityMaintainability
 Easily amenable to changeEasily amenable to change
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 99
Goals of a good designGoals of a good design
 Three characteristics that serves as aThree characteristics that serves as a guideguide for thefor the
evaluation of a good design:evaluation of a good design:
 Design mustDesign must
o
Implement all theImplement all the explicit requirementsexplicit requirements
o
Accommodate all theAccommodate all the implicit requirementsimplicit requirements
 Design must beDesign must be
o ReadableReadable
o Understandable guideUnderstandable guide for those who generate the code, whofor those who generate the code, who
test and who support the softwaretest and who support the software
 Design should provide a complete picture of the software,Design should provide a complete picture of the software,
addressingaddressing datadata,, functionsfunctions, and, and behavioral domainbehavioral domain fromfrom
an implementation perspective.an implementation perspective.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1010
UnderstandabilityUnderstandability
 Unless a design is easy to understand,Unless a design is easy to understand,
tremendoustremendous efforteffort needed to maintain it.needed to maintain it.
 We already know that aboutWe already know that about 60%60% efforteffort
is spent inis spent in maintenance.maintenance.
 If the software is not easy to understand:If the software is not easy to understand:
maintenance effort would increase manymaintenance effort would increase many
times.times.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1111
UnderstandabilityUnderstandability
 Use consistent and meaningful namesUse consistent and meaningful names
for various design components.for various design components.
 Design solution should consist of: aDesign solution should consist of: a cleanlycleanly
decomposeddecomposed set of modules (modularity).set of modules (modularity).
 Different modules should be neatly arranged inDifferent modules should be neatly arranged in
a hierarchy: in a neat tree-like diagram.a hierarchy: in a neat tree-like diagram.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1212
ModularityModularity
 Modularity is a fundamental attribute of anyModularity is a fundamental attribute of any
good design.good design.
 Decomposition of a problemDecomposition of a problem cleanly intocleanly into
modules facilitates the design by takingmodules facilitates the design by taking
advantage of theadvantage of the divide and conquerdivide and conquer principle.principle.
-Modules are almost-Modules are almost independentindependent of eachof each
other.other.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1313
Example of Cleanly and Non cleanlyExample of Cleanly and Non cleanly
Decomposed ModulesDecomposed Modules
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1414
Modularity…Modularity…
Neat arrangement of modules in a hierarchyNeat arrangement of modules in a hierarchy
means:means:
 low fan-outlow fan-out
 abstractionabstraction
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1515
Modularity…Modularity…
 If modules are independent:If modules are independent:
- modules can be- modules can be understoodunderstood separately,separately,
 To understand why this is so,To understand why this is so,
 remember that it is very difficult to break aremember that it is very difficult to break a
bunch of sticks but very easy to break thebunch of sticks but very easy to break the
sticks individually.sticks individually.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1616
Modularity…Modularity…
 ReducesReduces complexitycomplexity
 FacilitateFacilitate changeschanges
 Results in easier implementations byResults in easier implementations by
encouragingencouraging parallel developmentparallel development
of different parts of a system.of different parts of a system.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1717
Modularity…Modularity…
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1818
Functional IndependenceFunctional Independence
Benifits:Benifits:
 Better understandabilityBetter understandability and good design:and good design:
 Complexity of design is reducedComplexity of design is reduced,,
 Different modulesDifferent modules easily understood ineasily understood in
isolationisolation::
 Since different modules are independentSince different modules are independent
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1919
Functional Independence...Functional Independence...
 Functional independenceFunctional independence reduces errorreduces error
propagationpropagation..
 degree of interaction between modules isdegree of interaction between modules is
low.low.
 an error existing in one module does notan error existing in one module does not
directly affect other modules.directly affect other modules.
 Reuse of modulesReuse of modules is possible.is possible.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2020
Modularity…Modularity…
 In technical terms, modules shouldIn technical terms, modules should display:display:
----high cohesionhigh cohesion
----low coupling.low coupling.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2121
Cohesion and CouplingCohesion and Coupling
 Cohesion is a measure of:Cohesion is a measure of:
 functional strengthfunctional strength of a module.of a module.
 A cohesive moduleA cohesive module performs a single task orperforms a single task or
functionfunction..
 Coupling between two modules:Coupling between two modules:
 a measure of thea measure of the degree of interdependencedegree of interdependence
or interaction between the two modulesor interaction between the two modules..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2222
Classification of CohesivenessClassification of Cohesiveness
Classification is often subjective: yet gives usClassification is often subjective: yet gives us
some idea about cohesiveness of a module.some idea about cohesiveness of a module.
 By examining theBy examining the type of cohesiontype of cohesion exhibitedexhibited
by a module:by a module:
we can roughly tell whether it displays highwe can roughly tell whether it displays high
cohesion or low cohesioncohesion or low cohesion
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2323
Classification of CohesivenessClassification of Cohesiveness
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2424
Coincidental CohesionCoincidental Cohesion
 The module performs aThe module performs a set of tasks whichset of tasks which
relate to each other very looselyrelate to each other very loosely..
 Data elements or instructions within moduleData elements or instructions within module
havehave no relationno relation to each other.to each other.
 the module contains athe module contains a random collectionrandom collection ofof
functions.functions.
 functions have been put in the module out of purefunctions have been put in the module out of pure
coincidence without any thought or design.coincidence without any thought or design.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2525
 Example:(Example:(Coincidental Cohesion)Coincidental Cohesion)
FILE PROCESSINGFILE PROCESSING
OPEN EMPLOYEE UPDATE FILEOPEN EMPLOYEE UPDATE FILE
READ EMPLOYEE RECREAD EMPLOYEE REC
PRINT_PAGE_HEADINGPRINT_PAGE_HEADING
OPEN MASTER FILE(EMPLOYEE)OPEN MASTER FILE(EMPLOYEE)
SET PAGE_COUNT TO 1SET PAGE_COUNT TO 1
SET ERR_FLAG TO FALSESET ERR_FLAG TO FALSE
ENDEND
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2626
Logical cohesionLogical cohesion
 All elements of the module perform similarAll elements of the module perform similar
operations:operations:
 e.g. error handling, data input, data output,e.g. error handling, data input, data output,
etc.etc.
 Components are logically related to eachComponents are logically related to each
other.other.
 Modules which contains routines to supportModules which contains routines to support
different types of input.different types of input.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2727
 Example(Example(Logical CohesionLogical Cohesion))
READ_ALL_FILESREAD_ALL_FILES
CASE OF FILE_CODECASE OF FILE_CODE
1:READ CUST_TRAN REC1:READ CUST_TRAN REC
IF NOT EOFIF NOT EOF
INCREMENT_TRAN_COUNTINCREMENT_TRAN_COUNT
ENDIFENDIF
2:READ CUST_MASTER REC2:READ CUST_MASTER REC
IF NOT EOFIF NOT EOF
INCREMENT CUST_MASTER_COUNTINCREMENT CUST_MASTER_COUNT
ENDIFENDIF
3:READ PRODUCT_MASTER REC3:READ PRODUCT_MASTER REC
IF NOT EOFIF NOT EOF
INCREMENT PRODUCT_MASTER_COUNTINCREMENT PRODUCT_MASTER_COUNT
ENDIFENDIF
ENDCASEENDCASE
ENDEND
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2828
Temporal cohesionTemporal cohesion
 The module contains tasks that are related by theThe module contains tasks that are related by the
fact thatfact that all the tasks must be executed in the sameall the tasks must be executed in the same
time span.time span.
 Example:Example:
 Cancel all tasksCancel all tasks
 Cancel all windowsCancel all windows
 Cancel all data filesCancel all data files
 Shuts down the machinesShuts down the machines
 These tasks which are not logically or functionally relatedThese tasks which are not logically or functionally related
to each other, but takes place when ato each other, but takes place when a failurefailure occurs.occurs.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2929
 Example(Example(Temporal cohesion)Temporal cohesion)
INITIALIZATIONINITIALIZATION
OPEN TRAN_FILEOPEN TRAN_FILE
ISSUE PROMPT ‘ENTER DATE’ISSUE PROMPT ‘ENTER DATE’
READ TODAYS_DATEREAD TODAYS_DATE
SET TRAN_COUNT TO ZEROSET TRAN_COUNT TO ZERO
SET REPORT_TOTAL TO ZEROSET REPORT_TOTAL TO ZERO
OPEN REPORT_FILEOPEN REPORT_FILE
ENDEND
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3030
Procedural cohesionProcedural cohesion
 The set of functions of the module:The set of functions of the module:
all part of a procedure (algorithm)all part of a procedure (algorithm)
 certain sequence of steps have to be carriedcertain sequence of steps have to be carried
out in a certain order for achieving anout in a certain order for achieving an
objective.objective.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3131
 Example(Example(Procedural cohesion)Procedural cohesion)
READ STUD_REC AND TOTAL_STUD_AGESREAD STUD_REC AND TOTAL_STUD_AGES
NO_OF_REC=0NO_OF_REC=0
TOTAL_AGE=0TOTAL_AGE=0
READ STUD_RECREAD STUD_REC
DO WHILE MORE_REC_EXISTDO WHILE MORE_REC_EXIST
ADD AGE TO TOTAL_AGEADD AGE TO TOTAL_AGE
ADD 1 TO NO_OF_RECADD 1 TO NO_OF_REC
READ STUD_RECREAD STUD_REC
ENDDOENDDO
ENDEND
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3232
Communicational cohesionCommunicational cohesion
All functions of the moduleAll functions of the module reference or updatereference or update
the same data structure.the same data structure.
 Different outputs are generated on same inputDifferent outputs are generated on same input
 i.e.i.e. Communicational cohesionCommunicational cohesion occurs when twooccurs when two
operationsoperations share common datashare common data, but are otherwise, but are otherwise
unrelated.unrelated.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3333
 Example(Example(Communicational cohesion)Communicational cohesion)
PROCEDURE ERR_REPORTPROCEDURE ERR_REPORT
VALIDATEVALIDATE PRODUCT_RECPRODUCT_REC
IFIF TRAN_TYPETRAN_TYPE NOT=0 THENNOT=0 THEN
WRITE_ERR_REPORTWRITE_ERR_REPORT
ENDIFENDIF
IFIF CUST_NOCUST_NO NOT NUMERIC THENNOT NUMERIC THEN
WRITE ERR REPORTWRITE ERR REPORT
ENDIFENDIF
IFIF PRODUCT_NOPRODUCT_NO=BLANKS=BLANKS
WRITE ERR REPORTWRITE ERR REPORT
ENDIFENDIF
ENDEND
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3434
Sequential cohesionSequential cohesion
 Elements of a moduleElements of a module form different parts of aform different parts of a
sequencesequence, i.e., the output from one element of the, i.e., the output from one element of the
sequence is input to the next.sequence is input to the next.
 Example-1Example-1
Example-2Example-2
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3535
 Example(Example(Sequential cohesionSequential cohesion))
PROCESS PURCHASESPROCESS PURCHASES
TOTAL_PURCHASE=0TOTAL_PURCHASE=0
READ NO_OF_PURCHASESREAD NO_OF_PURCHASES
DO LOOP_INDEX=1 TO NO_OF_PURCHASESDO LOOP_INDEX=1 TO NO_OF_PURCHASES
GET PURCHASESGET PURCHASES
ADD PURCHASES TOADD PURCHASES TO TOTAL_PURCHASESTOTAL_PURCHASES
ENDDOENDDO
SALES_TAXSALES_TAX==TOTAL_PURCHASESTOTAL_PURCHASES*SALE_TAX_PERCENT*SALE_TAX_PERCENT
AMT_DUE=TOTAL_PURCHASES+AMT_DUE=TOTAL_PURCHASES+SALES_TAXSALES_TAX
ENDEND
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3636
Functional cohesionFunctional cohesion
 Different elements of a moduleDifferent elements of a module cooperate tocooperate to
achieve a single functionachieve a single function,,
 A simple example ofA simple example of functional cohesionfunctional cohesion is a math function.is a math function.
Pick any of them, sin(), cos (), or atan ()Pick any of them, sin(), cos (), or atan ()
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3737
 Example(Example(Functional cohesion)Functional cohesion)
CALCULATE_SALES_TAXCALCULATE_SALES_TAX
IF PRODUCT IS SALES_TAX EXEMPT THENIF PRODUCT IS SALES_TAX EXEMPT THEN
SALES_TAX=0SALES_TAX=0
ELSEELSE
IF PRODUCT_PRICE<$50 THENIF PRODUCT_PRICE<$50 THEN
SALES_TAX=PRODUCT_PRICE*0.25SALES_TAX=PRODUCT_PRICE*0.25
ENDIFENDIF
ENDIFENDIF
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3838
CouplingCoupling
 Coupling indicates:Coupling indicates:
 howhow closely two modules interactclosely two modules interact oror
howhow interdependent they areinterdependent they are..
 The degree of coupling between twoThe degree of coupling between two
modules depends on their interfacemodules depends on their interface
complexity.complexity.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3939
Classes of couplingClasses of coupling
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4040
Data couplingData coupling
 Two modules are data coupled,Two modules are data coupled, if theyif they
communicate via an elementary data item,communicate via an elementary data item,
---e.g. an integer, a float, a character, etc.---e.g. an integer, a float, a character, etc.
 The data item should beThe data item should be problem relatedproblem related,,
but not used for control purpose.but not used for control purpose.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4141
Stamp couplingStamp coupling
 Two modules areTwo modules are stamp coupledstamp coupled,, if theyif they
communicate via acommunicate via a composite data itemcomposite data item..
 such as a record in PASCALsuch as a record in PASCAL
 or a structure in C.or a structure in C.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4242
 Control couplingControl coupling
 Data from one module is used to direct theData from one module is used to direct the order oforder of
instruction execution in another.instruction execution in another.
 Example of control coupling:Example of control coupling:
 a flag set in one module and tested in another module.a flag set in one module and tested in another module.
 Common CouplingCommon Coupling
 Two modules areTwo modules are common coupledcommon coupled,, if they share someif they share some
global data.global data.
 Content couplingContent coupling
 Content coupling exists between two modulesContent coupling exists between two modules
share code,share code,
 e. g, branching from one module into anothere. g, branching from one module into another
module.module.
 When customer not found, component calls theWhen customer not found, component calls the
AddCustomer( ) method that is responsible forAddCustomer( ) method that is responsible for
maintaining customer data.maintaining customer data.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4343
Characteristics of ModuleCharacteristics of Module
StructureStructure
 DepthDepth :number of levels of control:number of levels of control
 Width:Width: overall span of control.overall span of control.
 Fan-out:Fan-out: a measure of the number of modulesa measure of the number of modules
directly controlled by given module.directly controlled by given module.
 Fan-in:Fan-in: indicates how many modules directlyindicates how many modules directly
invoke a given module.invoke a given module.
 High fan-in representsHigh fan-in represents code reusecode reuse and is inand is in
general encouraged.general encouraged.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4444
Fan-in & Fan-outFan-in & Fan-out
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4545
 A design having modules:A design having modules:
withwith high fan-outhigh fan-out numbersnumbers is not a goodis not a good
design:design:
 a module having high fan-outa module having high fan-out lacks cohesionlacks cohesion..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4646
Visibility and LayeringVisibility and Layering
 A module A is said to beA module A is said to be visiblevisible by anotherby another
module B, if A directly or indirectly calls B.module B, if A directly or indirectly calls B.
 TheThe layeringlayering principle requires modules at aprinciple requires modules at a
layerlayer can call onlycan call only the modules immediatelythe modules immediately
below it.below it.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4747
AbstractionAbstraction
 Lower-level modulesLower-level modules::
do input/output and other low-level functions.do input/output and other low-level functions.
 Upper-level modulesUpper-level modules::
do more managerial functions.do more managerial functions.
 The principle of abstraction requires:The principle of abstraction requires:
lower-level modules do not invoke functionslower-level modules do not invoke functions
of higher level modulesof higher level modules..
 Also known asAlso known as layered design.layered design.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4848
Design Concepts & PrinciplesDesign Concepts & Principles
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4949
 DFD serves two purposes:DFD serves two purposes:
 Provides an indication ofProvides an indication of how data are transformedhow data are transformed
as they move through the systemas they move through the system
 To depict theTo depict the functions (& sub-functions)functions (& sub-functions) thatthat
transform the data flow.transform the data flow.
 AA description of each functiondescription of each function presented in thepresented in the
DFD is contained in a processes specificationDFD is contained in a processes specification
((PSPECPSPEC).).
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5050
 STD indicatesSTD indicates how system behaves as ahow system behaves as a
consequence of external eventsconsequence of external events. It represents. It represents
various modes of behavior (state)various modes of behavior (state) of theof the
system & thesystem & the manner in which transitions aremanner in which transitions are
mademade from state to state.from state to state.
 Additional information about the controlAdditional information about the control
aspects of the software is contained in theaspects of the software is contained in the
control specificationscontrol specifications (CSPEC)(CSPEC)
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5151
 TheThe attributesattributes of each data objects noted in the ERof each data objects noted in the ER
diagram can be described usingdiagram can be described using data objectdata object
descriptiondescription..
 Data DesignData Design
 Transforms theTransforms the information domaininformation domain model createdmodel created
during analysis into theduring analysis into the data structuredata structure that will bethat will be
required to implement the software.required to implement the software.
 TheThe data objectsdata objects and the relationships defined in theand the relationships defined in the
ER diagramER diagram and theand the detailed data contentsdetailed data contents depicted indepicted in
data dictionary provides the basis for the data designdata dictionary provides the basis for the data design
activity.activity.
 Part of the designPart of the design occurs in conjunction with theoccurs in conjunction with the designdesign
of s/w architectureof s/w architecture andand more detailed data designmore detailed data design
occurs asoccurs as each s/w component is designed.each s/w component is designed.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5252
 Architectural DesignArchitectural Design
 Defines theDefines the relationships between majorrelationships between major
structural elementsstructural elements..
 Can be derived from theCan be derived from the system specification, thesystem specification, the
analysis model and the interactions ofanalysis model and the interactions of
subsystemssubsystems..
 Interface DesignInterface Design
 Describes how theDescribes how the software communicatessoftware communicates
within itself, with the system that interoperatewithin itself, with the system that interoperate
with it and with humans who use it.with it and with humans who use it.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5353
 Component Level DesignComponent Level Design
 TransformsTransforms structural elementsstructural elements of the softwareof the software
architecture intoarchitecture into procedural description of softwareprocedural description of software
component.component.
 Information obtained from PSPEC, CSPEC, &Information obtained from PSPEC, CSPEC, &
STD serves as basis for component design.STD serves as basis for component design.
 Software design serves as the foundation forSoftware design serves as the foundation for
all the software engineering and softwareall the software engineering and software
support steps that follow.support steps that follow.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5454
Design Concepts…Design Concepts…
 AA set of fundamental software design conceptsset of fundamental software design concepts has evolvedhas evolved
over past four decades. Each provides the software designerover past four decades. Each provides the software designer
with a foundation from which more sophisticated designwith a foundation from which more sophisticated design
methods can be applied.methods can be applied.
1.1. ABSTRACTIONABSTRACTION
2.2. REFINEMENTREFINEMENT
3.3. MODULARITYMODULARITY
4.4. SOFTWARE ARCHITECTURESOFTWARE ARCHITECTURE
5.5. CONTROL HIERARCHYCONTROL HIERARCHY
6.6. STRUCTURAL PARTITIONINGSTRUCTURAL PARTITIONING
7.7. DATA STRUCTUREDATA STRUCTURE
8.8. SOFTWARE PROCEDURESOFTWARE PROCEDURE
9.9. INFORMATION HIDINGINFORMATION HIDING
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5555
AbstractionAbstraction
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5656
 Procedural AbstractionProcedural Abstraction
 It is a namedIt is a named sequence of instructionssequence of instructions that has athat has a
specific and limited function.specific and limited function.
 E.g.E.g. OPEN A DOOROPEN A DOOR is a long sequence ofis a long sequence of
procedural stepsprocedural steps
1. walk to the door
2. Reach out and grasp the knob
3. Turn knob & pull door
4. Step away from moving door etc.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5757
 Data AbstractionData Abstraction
 Is a namedIs a named collection of datacollection of data describes a datadescribes a data
objectobject
 E.g.E.g. DOORDOOR; The attributes are; The attributes are
1.1. Door typeDoor type
2.2. Swing directionSwing direction
3.3. Opening mechanismOpening mechanism
4.4. WeightWeight
5.5. Dimension etc.Dimension etc.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5858
 Control AbstractionControl Abstraction
It implies aIt implies a program control mechanism withoutprogram control mechanism without
specifying internal detailsspecifying internal details
 e.g.e.g.Thread managementThread management in a multithreadingin a multithreading
environmentenvironment
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5959
RefinementRefinement
-It is the-It is the top down designtop down design strategy.strategy.
-In each step(of refinement), one or several-In each step(of refinement), one or several
instructions of the given program areinstructions of the given program are
decomposed into more detail instructions.decomposed into more detail instructions.
-Refinement is actually a-Refinement is actually a process of elaboration.process of elaboration.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6060
ArchitectureArchitecture
 Architecture is theArchitecture is the hierarchical structure of ahierarchical structure of a
program components (modules)program components (modules), the manner in, the manner in
which thesewhich these components interactcomponents interact and theand the
structure of datastructure of data that are used by thethat are used by the
component.component.
-- Client Server Architecture-- Client Server Architecture
-- Main program/Subprogram Architecture-- Main program/Subprogram Architecture
-- Layered Architecture(core layer, utility layer,-- Layered Architecture(core layer, utility layer,
application layer, user interface layer)application layer, user interface layer)
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6161
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6262
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6363
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6464
Control HierarchyControl Hierarchy
(program structure)(program structure)
 It represents theIt represents the organization of the programorganization of the program
components (modules)components (modules) and implies aand implies a hierarchyhierarchy
of controlof control..
 ItIt does not represents the procedural aspectdoes not represents the procedural aspect ofof
software.software.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6565
Control HierarchyControl Hierarchy CONT…CONT…
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6666
Structural partitioningStructural partitioning
 For aFor a hierarchical style of architecturehierarchical style of architecture the programthe program
module can be partitioned into:module can be partitioned into:
 HorizontalHorizontal
 VerticalVertical
 Horizontal partitioningHorizontal partitioning defines separate branches of the modulardefines separate branches of the modular
hierarchy for each major program function.hierarchy for each major program function.
Simplest way is to partition a system into:Simplest way is to partition a system into: input, datainput, data
transformation (processing), and output.transformation (processing), and output.
AdvantagesAdvantages of horizontal partition:of horizontal partition:
-- easy to test, maintain, and extendeasy to test, maintain, and extend
- fewer side effects in change propagation or error propagation- fewer side effects in change propagation or error propagation
Disadvantage:Disadvantage: more data to be passed across module interfaces -more data to be passed across module interfaces -
complicate the overall control of program flowcomplicate the overall control of program flow
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6767
 Vertical partitioningVertical partitioning suggests the control andsuggests the control and
work should be distributed top-down inwork should be distributed top-down in
program structure.program structure.
Advantages:Advantages:
- good at dealing with changes:- good at dealing with changes:
- easy to maintain the changes- easy to maintain the changes
- reduce the change impact and and- reduce the change impact and and
propagationpropagation
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6868
Data StructureData Structure
 Represents theRepresents the logical relationshiplogical relationship among individualamong individual
elements of data.elements of data.
 It indicates theIt indicates the
 Organization of dataOrganization of data
 Method of accessMethod of access
 Degree of associativenessDegree of associativeness
 Process alternatives for informationProcess alternatives for information
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6969
Software ProcedureSoftware Procedure
 Program structure define control hierarchy withoutProgram structure define control hierarchy without
regard to the sequence of processing and decision.regard to the sequence of processing and decision.
 SoftwareSoftware focuses on the processing details of eachfocuses on the processing details of each
module individually.module individually.
 Procedure must provide a precise specification ofProcedure must provide a precise specification of
processing includingprocessing including
 Sequence of eventsSequence of events
 Exact decision pointsExact decision points
 Repetitive operations, data organization and structureRepetitive operations, data organization and structure
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7070
Information HidingInformation Hiding
 Modules be characterized by design decisionModules be characterized by design decision
thatthat each module hides from all otherseach module hides from all others..
 i.e. information (i.e. information (data & proceduredata & procedure) contained) contained
within a module is inaccessible to otherwithin a module is inaccessible to other
modulesmodules that have no need for suchthat have no need for such
information.information.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7171
Structured AnalysisStructured Analysis
 Transforms a textual problem description intoTransforms a textual problem description into
a graphic model.a graphic model.
–– Done usingDone using DDataata FFlowlow DDiagramsiagrams (DFDs).(DFDs).
 –– DFDs graphically represent the results ofDFDs graphically represent the results of
structured analysis.structured analysis.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7272
 DFD is an elegant modeling technique:DFD is an elegant modeling technique:
 –– Useful not only to represent the results ofUseful not only to represent the results of
structured analysis.structured analysis.
 –– Applicable to other areas also:Applicable to other areas also:
e.g. for showing thee.g. for showing the flow of documentsflow of documents oror
itemsitems in an organization,in an organization,
 DFD technique is very popular:DFD technique is very popular:
–– It is powerful and yet simple to understandIt is powerful and yet simple to understand
and use.and use.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7373
 DFD is aDFD is a hierarchical graphical modelhierarchical graphical model::
 –– Shows the differentShows the different functionsfunctions (or(or processesprocesses))
of the system andof the system and
 –– Data interchangeData interchange among the processes.among the processes.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7474
It is useful to consider each function as aIt is useful to consider each function as a
processing station:processing station:
 ––Each functionEach function consumesconsumes somesome input datainput data..
 ––ProducesProduces somesome output data.output data.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7575
 Data Flow Model of a Car Assembly UnitData Flow Model of a Car Assembly Unit
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7676
 A DFD model:A DFD model:
–– UsesUses limited types of symbols.limited types of symbols.
–– Simple set of rulesSimple set of rules
–– Easy to understand:Easy to understand:
It is aIt is a hierarchicalhierarchical model.model.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7777
 Primitive Symbols Used for ConstructingPrimitive Symbols Used for Constructing
DFDs:DFDs:
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7878
External Entity SymbolExternal Entity Symbol
 Represented by a rectangleRepresented by a rectangle
 External entities are real physical entities:External entities are real physical entities:
–– input data to the system orinput data to the system or
–– consume data produced by the system.consume data produced by the system.
–– Sometimes external entities are calledSometimes external entities are called
terminator, source, or sink.terminator, source, or sink.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7979
Function SymbolFunction Symbol
 A function such as “A function such as “search-booksearch-book” is” is
represented using a circle:represented using a circle:
 –– This symbol is called aThis symbol is called a processprocess oror bubblebubble oror
transform.transform.
 –– Bubbles are annotated with correspondingBubbles are annotated with corresponding
function names.function names.
 –– Functions represent some activity:Functions represent some activity:
 FunctionFunction namesnames should beshould be verbsverbs..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8080
Data Flow SymbolData Flow Symbol
 A directed arc or line.A directed arc or line.
 –– RepresentsRepresents data flowdata flow in the direction of thein the direction of the
arrow.arrow.
 –– Data flow symbols are annotated with namesData flow symbols are annotated with names
of data they carry.of data they carry.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8181
Data Store SymbolData Store Symbol
 Represents a logical file:Represents a logical file:
 –– A logical file can be:A logical file can be:
-- a data structurea data structure
-- a physical file on disk.a physical file on disk.
 –– Each data store is connected to a process:Each data store is connected to a process:
by means of a data flow symbol.by means of a data flow symbol.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8282
 Direction of data flow arrow:Direction of data flow arrow:
–– Shows whether data is beingShows whether data is being read fromread from oror
written intowritten into it.it.
 An arrow into or out of a data storeAn arrow into or out of a data store
–– ImplicitlyImplicitly represents the entire data of therepresents the entire data of the
data storedata store
 –– Arrows connecting to a data store need notArrows connecting to a data store need not
be annotated with any data name.be annotated with any data name.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8383
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8484
Output SymbolOutput Symbol
 Output produced by the systemOutput produced by the system
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8585
Synchronous OperationSynchronous Operation
 If two bubbles are directly connected by a dataIf two bubbles are directly connected by a data
flow arrow: they areflow arrow: they are synchronoussynchronous..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8686
Asynchronous OperationAsynchronous Operation
 If two bubbles are connected via a data store:If two bubbles are connected via a data store:
they are not synchronous.they are not synchronous.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8787
 Initially represent the software at theInitially represent the software at the mostmost
abstractabstract level:level:
–– Called theCalled the context diagramcontext diagram..
 –– The entire system is represented asThe entire system is represented as
aa single bubblesingle bubble,,
 –– This bubble isThis bubble is labeledlabeled according to theaccording to the mainmain
functionfunction of the system.of the system.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8888
Tic-tac-toe: Context DiagramTic-tac-toe: Context Diagram
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8989
 AA context diagramcontext diagram shows:shows:
––DataData inputinput to the system,to the system,
––Output data generated by the system,Output data generated by the system,
––External entitiesExternal entities
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9090
 Context diagramContext diagram captures:captures:
–– Various entities external to the systemVarious entities external to the system
and interacting with it.and interacting with it.
–– Data flow occurring between the system andData flow occurring between the system and
the external entitiesthe external entities..
 The context diagram is also called as theThe context diagram is also called as the levellevel
0 DFD.0 DFD.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9191
 Context Diagram Establishes the context of theContext Diagram Establishes the context of the
system, i.e.system, i.e.
––Represents:Represents:
Data sourcesData sources
Data sinks.Data sinks.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9292
Level 1 DFDLevel 1 DFD
Examine the SRS document:Examine the SRS document:
 –– Represent each high-levelRepresent each high-level function as afunction as a
bubblebubble..
 –– RepresentRepresent data inputdata input to every high levelto every high level
function.function.
 –– RepresentRepresent data outputdata output from everyfrom every
high-level function.high-level function.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9393
Higher Level DFDsHigher Level DFDs
 Each high-level function is separatelyEach high-level function is separately
decomposed intodecomposed into sub functionssub functions::
–– Identify the sub-functions of the functionIdentify the sub-functions of the function
–– Identify the data input to each sub-functionIdentify the data input to each sub-function
–– Identify the data output from each sub-Identify the data output from each sub-
functionfunction
 These are represented as DFDs.These are represented as DFDs.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9494
Decomposition of a bubble:Decomposition of a bubble:
–– Also calledAlso called factoringfactoring oror explodingexploding..
 Each bubble is decomposed toEach bubble is decomposed to
–– BetweenBetween 33 toto 77 bubbles.bubbles.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9595
Example 1: RMS CalculatingExample 1: RMS Calculating
SoftwareSoftware
 Consider a software calledConsider a software called RMS calculatingRMS calculating
software:software:
 –– ReadsReads three integers in the range ofthree integers in the range of - 1000- 1000
and +1000and +1000
 –– Finds outFinds out thethe root mean squareroot mean square (rms) of(rms) of
the three input numbersthe three input numbers
 –– Displays the resultDisplays the result..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9696
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9797
 Accept input numbers from the user:Accept input numbers from the user:
–– ValidateValidate the numbers,the numbers,
–– CalculateCalculate the root mean square of the inputthe root mean square of the input
numbersnumbers
–– DisplayDisplay the result.the result.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9898
Level 1 DFD for RMS SoftwareLevel 1 DFD for RMS Software
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9999
Level 2 DFD for RMS SoftwareLevel 2 DFD for RMS Software
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 100100
Level 3 DFD for RMS SoftwareLevel 3 DFD for RMS Software
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 101101
 Decomposition is never carried on up to basicDecomposition is never carried on up to basic
instruction level:instruction level:
–– A bubble is not decomposed any further:A bubble is not decomposed any further:
 If it can be represented by a simple set ofIf it can be represented by a simple set of
instructionsinstructions
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 102102
Balancing a DFDBalancing a DFD
 Data flowing into or out of a bubble:Data flowing into or out of a bubble:
 –– Must match the data flows at the next levelMust match the data flows at the next level
of DFD. In the level 1 of the DFD,of DFD. In the level 1 of the DFD,
 –– Data item c flows into the bubble P3 and theData item c flows into the bubble P3 and the
data item d and e flow out.data item d and e flow out.
 ●● In the next level, bubble P3 is decomposed.In the next level, bubble P3 is decomposed.
 –– The decomposition is balanced as data item cThe decomposition is balanced as data item c
flows into the level 2 diagram and d and e flowflows into the level 2 diagram and d and e flow
out.out.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 103103
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 104104
 Number the bubbles in a DFD:Number the bubbles in a DFD:
 –– Numbers help inNumbers help in uniquely identifyinguniquely identifying anyany
bubble from its bubble number.bubble from its bubble number.
 The bubble at context level: Assigned number 0.The bubble at context level: Assigned number 0.
 Bubbles at level 1:Bubbles at level 1: – Numbered– Numbered 0.1, 0.2,0.1, 0.2, etc.etc.
 When a bubble numberedWhen a bubble numbered x is decomposedx is decomposed,,
 –– Its children bubble are numberedIts children bubble are numbered x.1, x.2, x.3,x.1, x.2, x.3,
etc.etc.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 105105
Data DictionaryData Dictionary
 A DFD is always accompanied by a data dictionary.A DFD is always accompanied by a data dictionary.
 A data dictionary lists all data items appearing in aA data dictionary lists all data items appearing in a
DFD:DFD:
 Definition of all composite data items in terms ofDefinition of all composite data items in terms of
their component data items.their component data items.
 All data names along with the purpose of the dataAll data names along with the purpose of the data
items.items.
 For example, a data dictionary entry may be:For example, a data dictionary entry may be:
 grossPay = regularPay+overtimePaygrossPay = regularPay+overtimePay
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 106106
Importance of Data DictionaryImportance of Data Dictionary
 Provides all engineers in a project withProvides all engineers in a project with
standard terminologystandard terminology for all data:for all data:
 –– AA consistentconsistent vocabulary for data is veryvocabulary for data is very
importantimportant
 –– Different engineers tend to use differentDifferent engineers tend to use different
terms to refer to the same data, Causesterms to refer to the same data, Causes
unnecessary confusion.unnecessary confusion.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 107107
Importance of Data DictionaryImportance of Data Dictionary
 Data dictionary provides the definition ofData dictionary provides the definition of
different data: In terms of their componentdifferent data: In terms of their component
elements.elements.
 For large systems, The data dictionary growsFor large systems, The data dictionary grows
rapidly inrapidly in sizesize andand complexitycomplexity..
 –– Typical projects can have thousands of dataTypical projects can have thousands of data
dictionary entries.dictionary entries.
–– It is extremely difficult to maintain such aIt is extremely difficult to maintain such a
dictionary manually.dictionary manually.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 108108
 CASECASE (Computer Aided Software Engineering)(Computer Aided Software Engineering)
tools come handy:tools come handy:
–– CASE tools capture the data items appearingCASE tools capture the data items appearing
in a DFD automatically to generate the datain a DFD automatically to generate the data
dictionarydictionary
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 109109
 Composite data are defined in terms ofComposite data are defined in terms of
primitive data items using following operators:primitive data items using following operators:
 ++: denotes: denotes composition of data itemscomposition of data items,,
e.g. – a+b represents data a and b.e.g. – a+b represents data a and b.
 [,,,][,,,]: represents: represents selectionselection,,
 –– i.e. any one of the data items listed inside thei.e. any one of the data items listed inside the
square bracket can occur.square bracket can occur.
 –– For example, [a,b] represents either a occursFor example, [a,b] represents either a occurs
or b occurs.or b occurs.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 110110
 ( )( ): contents inside the bracket represent: contents inside the bracket represent
optional dataoptional data
–– which may or may not appear.which may or may not appear.
e.g. – a+(b) represents either a or a+b occurs.e.g. – a+(b) represents either a or a+b occurs.
 {}{}: represents: represents iterative data definitioniterative data definition,,
–– e.g. {name}5 represents five name data.e.g. {name}5 represents five name data.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 111111
 {name}*{name}* representsrepresents
–– zero or more instances of name data.zero or more instances of name data.
 == representsrepresents equivalenceequivalence,,
–– e.g. a=b+c means that a represents b and c.e.g. a=b+c means that a represents b and c.
 * ** *: Anything appearing within * * is: Anything appearing within * * is
considered asconsidered as commentcomment..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 112112
Data Dictionary for RMS SoftwareData Dictionary for RMS Software
numbers=valid-numbers=a+b+cnumbers=valid-numbers=a+b+c
a:integer * input number *a:integer * input number *
b:integer * input number *b:integer * input number *
c:integer * input number *c:integer * input number *
asq:integerasq:integer
bsq:integerbsq:integer
csq:integercsq:integer
squared-sum: integersquared-sum: integer
Result=[RMS,error]Result=[RMS,error]
RMS: integerRMS: integer * root mean square value** root mean square value*
error: stringerror: string * error message** error message*
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 113113
 DuringDuring structured designstructured design,,
 –– The DFD representation is transformed to aThe DFD representation is transformed to a
structure chartstructure chart representation.representation.
 ●● DFDs are very popular:DFDs are very popular:
 –– Because it is a veryBecause it is a very simple techniquesimple technique..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 114114
 A DFD model:A DFD model:
–– Difficult to implementDifficult to implement using a programmingusing a programming
language:language:
 Structure chart representation can be easilyStructure chart representation can be easily
implemented using a programming language.implemented using a programming language.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 115115
Trading-House AutomationTrading-House Automation
System (TAS)System (TAS)
 A large trading house wants us to develop aA large trading house wants us to develop a
software:software:
 –– ToTo automate book keeping activitiesautomate book keeping activities
associated with its business.associated with its business.
 It has manyIt has many regular customersregular customers::
–– WhoWho place ordersplace orders for various kinds offor various kinds of
commodities.commodities.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 116116
 The trading house maintainsThe trading house maintains names andnames and
addressesaddresses of its regular customers.of its regular customers.
 Each customer isEach customer is assigned a uniqueassigned a unique
customer identificationcustomer identification number (CIN).number (CIN).
 As per current practice when aAs per current practice when a customercustomer
places orderplaces order::
 –– The accounts department first checks theThe accounts department first checks the
credit-worthinesscredit-worthiness of the customerof the customer
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 117117
 The credit worthiness of a customer isThe credit worthiness of a customer is
determined:determined:
 –– ByBy analyzing the history of his paymentsanalyzing the history of his payments
to the bills sent to him in the past.to the bills sent to him in the past.
 If a customer is not credit-worthy:If a customer is not credit-worthy:
 –– His ordersHis orders areare not processednot processed any furtherany further
–– An appropriateAn appropriate order rejection messageorder rejection message isis
generated for the customer.generated for the customer.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 118118
 If a customer is credit-worthy:If a customer is credit-worthy:
 –– Items he/she has ordered are checkedItems he/she has ordered are checked
against the list of items the trading houseagainst the list of items the trading house
deals with.deals with.
 The items that theThe items that the trading house does nottrading house does not
deal withdeal with::
–– AreAre not processednot processed any furtherany further
–– AnAn appropriate messageappropriate message for the customer forfor the customer for
these items is generated.these items is generated.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 119119
 The items in a customer's order that theThe items in a customer's order that the
trading house deals with:trading house deals with:
 –– AreAre checked for availabilitychecked for availability in inventory.in inventory.
 If the items are available in the inventory inIf the items are available in the inventory in
desired quantities:desired quantities:
 –– AA bill with the forwarding address of thebill with the forwarding address of the
customer is printedcustomer is printed..
 –– AA material issue slipmaterial issue slip is printed.is printed.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 120120
 The customer can produce theThe customer can produce the material issuematerial issue
slipslip at the storehouse:at the storehouse:
 –– Take delivery of the items.Take delivery of the items.
 –– Inventory data adjusted to reflect the sale toInventory data adjusted to reflect the sale to
the customer.the customer.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 121121
 If an ordered item is not available in theIf an ordered item is not available in the
inventory in sufficient quantity:inventory in sufficient quantity:
 –– To be able to fulfillTo be able to fulfill pending orderspending orders storestore
details in a "details in a "pending-orderpending-order" file :" file :
 out-of-stockout-of-stock items along with quantityitems along with quantity
ordered. customer identification numberordered. customer identification number
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 122122
 The purchase department: wouldThe purchase department: would periodicallyperiodically
issue commands to generate indentsissue commands to generate indents..
 When generate indents command is issued:When generate indents command is issued:
 –– The system should examine theThe system should examine the
"pendingorder“"pendingorder“ filefile
–– Determine theDetermine the ordersorders that are pendingthat are pending
–– Total quantityTotal quantity required for each of the items.required for each of the items.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 123123
 TAS should find out theTAS should find out the addresses of theaddresses of the
vendorsvendors who supply the required items:who supply the required items:
–– ExamineExamine the file containingthe file containing vendorvendor
detailsdetails (their address, items they supply etc.)(their address, items they supply etc.)
–– Print out indentsPrint out indents to those vendorsto those vendors
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 124124
 TAS should also answersTAS should also answers managerial queriesmanagerial queries::
 –– Statistics of different items soldStatistics of different items sold over anyover any
given period of timegiven period of time
 –– CorrespondingCorresponding quantity sold and the pricequantity sold and the price
realized.realized.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 125125
Context Diagram for TASContext Diagram for TAS
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 126126
Level 1 DFD for TASLevel 1 DFD for TAS
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 127127
Data Dictionary for TASData Dictionary for TAS
 response: [bill + material-issue-slip, reject-response: [bill + material-issue-slip, reject-
message]message]
 query: period /* query from manager regardingquery: period /* query from manager regarding
sales statistics*/sales statistics*/
 period: [date+date,month,year,day]period: [date+date,month,year,day]
 date: year + month + daydate: year + month + day
 year: integeryear: integer
 month: integermonth: integer
 day: integerday: integer
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 128128
 order: customer-id + {items + quantity}*order: customer-id + {items + quantity}*
 accepted-order: order /* ordered itemsaccepted-order: order /* ordered items
available in inventory */available in inventory */
 reject-message: order + message /* rejectionreject-message: order + message /* rejection
message */message */
 pending-orders: customer-id +pending-orders: customer-id +
{items+quantity}*{items+quantity}*
 customer-address:customer-address: name+house#+street#+city+pinname+house#+street#+city+pin
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 129129
 item-name: stringitem-name: string
 house#: stringhouse#: string
 street#: stringstreet#: string
 city: stringcity: string
 pin: integerpin: integer
 customer-id: integercustomer-id: integer
 bill: {item + quantity + price}* + total-amount +bill: {item + quantity + price}* + total-amount +
customer-addresscustomer-address
 material-issue-slip: message + item + quantity + customer-material-issue-slip: message + item + quantity + customer-
addressaddress
 message: stringmessage: string
 statistics: {item + quantity + price }*statistics: {item + quantity + price }*
 sales-statistics: {statistics}*sales-statistics: {statistics}*
 quantity: integerquantity: integer
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 130130
 Guidelines For Constructing DFDsGuidelines For Constructing DFDs
 Context diagramContext diagram should representshould represent
the system as athe system as a single bubblesingle bubble::
 –– Many beginners commit the mistake ofMany beginners commit the mistake of
drawing more than one bubble in the contextdrawing more than one bubble in the context
diagram.diagram.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 131131
 AllAll external entitiesexternal entities should be represented inshould be represented in
thethe context diagramcontext diagram::
 –– External entities should not appear at anyExternal entities should not appear at any
other level of DFD.other level of DFD.
 Only 3 to 7 bubbles per diagram should beOnly 3 to 7 bubbles per diagram should be
allowed: Each bubble should be decomposed toallowed: Each bubble should be decomposed to
between 3 and 7 bubbles.between 3 and 7 bubbles.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 132132
 A common mistake committed by manyA common mistake committed by many
beginners:beginners:
 –– Attempting to represent controlAttempting to represent control
information in a DFD.information in a DFD.
 –– e.g. trying to represent thee.g. trying to represent the orderorder in whichin which
different functions are executed.different functions are executed.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 133133
 A DFDA DFD does notdoes not representrepresent controlcontrol
information:information:
 –– The conditions under which differentThe conditions under which different
functions are invoked are not represented.functions are invoked are not represented.
 –– For example, a function might invoke oneFor example, a function might invoke one
function or another depending on somefunction or another depending on some
condition.condition.
 –– Many beginners try to represent this aspectMany beginners try to represent this aspect
by drawing an arrow between theby drawing an arrow between the
corresponding bubbles.corresponding bubbles.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 134134
Shortcomings of the DFD ModelShortcomings of the DFD Model
DFD models suffer from several shortcomings:DFD models suffer from several shortcomings:
●● DFDs leave ample scope to beDFDs leave ample scope to be impreciseimprecise..
–– In a DFD model, we infer about the functionIn a DFD model, we infer about the function
performed by a bubble from its label.performed by a bubble from its label.
–– A label may not capture all the functionalityA label may not capture all the functionality
of a bubbleof a bubble
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 135135
For example, a bubble named find-bookpositionFor example, a bubble named find-bookposition
has only intuitive meaning:has only intuitive meaning:
–– Does not specify several things:Does not specify several things:
●● What happens when someWhat happens when some input informationinput information
is missing or is incorrectis missing or is incorrect..
●● Does not convey anything regardingDoes not convey anything regarding whatwhat
happens when book is not foundhappens when book is not found
●● or what happens if there are books by differentor what happens if there are books by different
authors with the same book title.authors with the same book title.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 136136
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 137137
A DFD does notA DFD does not specifyspecify synchronizationsynchronization
aspectsaspects::
–– For instance, the DFD in TAS example doesFor instance, the DFD in TAS example does
not specify:not specify:
●● WhetherWhether process-order may wait until theprocess-order may wait until the
accept-order produces dataaccept-order produces data
●● WhetherWhether accept-order and handle-orderaccept-order and handle-order
may proceed simultaneouslymay proceed simultaneously with somewith some
buffering mechanism between thembuffering mechanism between them
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 138138
The way decomposition is carried out to arrive atThe way decomposition is carried out to arrive at
the successive levels of a DFD isthe successive levels of a DFD is subjectivesubjective..
●● The ultimate level to which decomposition isThe ultimate level to which decomposition is
carried out is subjective:carried out is subjective:
–– Depends on theDepends on the choice and judgement of thechoice and judgement of the
analyst.analyst.
●● Even for theEven for the same problem,same problem,
–– Several alternative DFD representationsSeveral alternative DFD representations areare
possible:possible:
–– Many times it is not possible to say whichMany times it is not possible to say which
DFD representation is superior or preferable.DFD representation is superior or preferable.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 139139
DFD technique does not provide:DFD technique does not provide:
–– Any clear guidance as to how exactly oneAny clear guidance as to how exactly one
should goshould go about decomposingabout decomposing a function:a function:
–– One has to useOne has to use subjective judgementsubjective judgement to carryto carry
out decomposition.out decomposition.
●● Structured analysis techniques do not specifyStructured analysis techniques do not specify
when to stop a decomposition processwhen to stop a decomposition process::
–– To what length decomposition needs to beTo what length decomposition needs to be
carried out.carried out.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 140140
Structured DesignStructured Design
 Aim is to transform the result ofAim is to transform the result of structuredstructured
analysisanalysis ( i.e. DFD )into( i.e. DFD )into structured chart.structured chart.
 A structured chart represents the softwareA structured chart represents the software
architecture, i.e. the various modules makingarchitecture, i.e. the various modules making
up the system, the module dependency and theup the system, the module dependency and the
parameters that are passed among the differentparameters that are passed among the different
modulesmodules
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 141141
The building blocks of structured chart:The building blocks of structured chart:
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 142142
 One and onlyOne and only one moduleone module at the topat the top
• At mostAt most one control relationshipone control relationship between any twobetween any two
modules. (modules arranged in Layers / levels)modules. (modules arranged in Layers / levels)
 The principle ofThe principle of abstractionabstraction doses not allowdoses not allow
the lower level modules to be aware of thethe lower level modules to be aware of the
existence of the higher level modulesexistence of the higher level modules
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 143143
Transformation of a DFD into aTransformation of a DFD into a
Structured Chart:Structured Chart:
1)1) Transform AnalysisTransform Analysis
2)2) Transaction AnalysisTransaction Analysis
 Start with 1 Level DFD and then proceed toStart with 1 Level DFD and then proceed to
lower level DFDslower level DFDs
 At each level of transformation, determineAt each level of transformation, determine
whether it iswhether it is transformtransform oror transactiontransaction
analysis applicable??analysis applicable??
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 144144
Transform AnalysisTransform Analysis
 If all dataIf all data inputinput to the diagram areto the diagram are processedprocessed
in a similar waysin a similar ways (i.e. if all input data are(i.e. if all input data are
incident on the same bubble in the DFD), thenincident on the same bubble in the DFD), then
transform analysis is applicable.transform analysis is applicable.
 It is applicable toIt is applicable to very small problemsvery small problems or ator at
the lower level DFD.the lower level DFD.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 145145
Transaction AnalysisTransaction Analysis
 Each different way in which data is processedEach different way in which data is processed
corresponds to a separate transaction.corresponds to a separate transaction.
 Each transaction corresponds to aEach transaction corresponds to a
functionality.functionality.
 Useful for transaction processing systemUseful for transaction processing system
 For each transaction, we trace the input data toFor each transaction, we trace the input data to
the output data.the output data.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 146146
 The transaction is identified by studying theThe transaction is identified by studying the
discrete event types that drive the systemdiscrete event types that drive the system
 The threeThe three transaction typestransaction types here are:here are: CheckCheck
Availability (an enquiry), Reserve TicketAvailability (an enquiry), Reserve Ticket
(booking) and Cancel Ticket (cancellation)(booking) and Cancel Ticket (cancellation)..
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 147147
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 148148
Transform AnalysisTransform Analysis
 Transform analysis is strategy of convertingTransform analysis is strategy of converting
each piece of DFD (may be from level 2 oreach piece of DFD (may be from level 2 or
level 3, etc.) for all the identified transactionlevel 3, etc.) for all the identified transaction
centers.centers.
 In case, the given system has only oneIn case, the given system has only one
transaction (like a payroll system), then we cantransaction (like a payroll system), then we can
start transformation from level 1 DFD itself.start transformation from level 1 DFD itself.
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 149149
 Transform analysis is composed of theTransform analysis is composed of the
following five steps:following five steps:
1.1. Draw a DFD of a transaction type (usually doneDraw a DFD of a transaction type (usually done
during analysis phase)during analysis phase)
2.2. Find theFind the central functionscentral functions of the DFDof the DFD
3.3. Convert the DFD into a first-cut structure chartConvert the DFD into a first-cut structure chart
4.4. Refine the structure chartRefine the structure chart
5.5. Verify that the final structure chart meets theVerify that the final structure chart meets the
requirements of the original DFDrequirements of the original DFD
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 150150
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 151151
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 152152
Partitioning DFDPartitioning DFD
 Transformation-Centered Application:Transformation-Centered Application:
 Data flow in a sequence, i.e. in a straight lineData flow in a sequence, i.e. in a straight line
manner.manner.
 Focus is on file handling and manipulation of data.Focus is on file handling and manipulation of data.
 Example: Sequential processing of a purchaseExample: Sequential processing of a purchase
orderorder
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 153153
Transformation Analysis…Transformation Analysis…
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 154154
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 155155
Transaction Analysis…Transaction Analysis…
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 156156
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 157157
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 158158
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 159159
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 160160
01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 161161

More Related Content

Similar to Software Design

The Language of Application Architecture
The Language of Application ArchitectureThe Language of Application Architecture
The Language of Application Architecture
Brad Beiermann
 
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
chess188chess188
 
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
chess188chess188
 
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
ghodgkinson
 
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
siouxhotornot
 
Object Oriented System Design
Object Oriented System DesignObject Oriented System Design
Object Oriented System Design
Dr. ARUP ABHINNA ACHARYA
 
Design concepts and principle,
Design concepts and principle, Design concepts and principle,
Design concepts and principle,
awikhan12
 
VS Code and Modern Development Environment Preview
VS Code and Modern Development Environment PreviewVS Code and Modern Development Environment Preview
VS Code and Modern Development Environment Preview
Roberto Stefanetti
 
Modular Enterprise Systems - An Introduction
Modular Enterprise Systems - An IntroductionModular Enterprise Systems - An Introduction
Modular Enterprise Systems - An Introduction
Andreas Weidinger
 
AutoDesk Inventor Professional-2018
AutoDesk Inventor Professional-2018AutoDesk Inventor Professional-2018
AutoDesk Inventor Professional-2018
Umair Ahmad
 
Customer Centric View of Best Practices in Software Monetization
Customer Centric View of Best Practices in Software MonetizationCustomer Centric View of Best Practices in Software Monetization
Customer Centric View of Best Practices in Software Monetization
team-WIBU
 
Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12Stephan Hochdörfer
 
Eclipse Summit 2008 - Thales - SolFa
Eclipse Summit 2008 - Thales - SolFaEclipse Summit 2008 - Thales - SolFa
Eclipse Summit 2008 - Thales - SolFa
BENOIT_LANGLOIS
 
Next Generation Component Management - Altium Designer
Next Generation Component Management - Altium DesignerNext Generation Component Management - Altium Designer
Next Generation Component Management - Altium Designer
Altium
 
How to Speak the Language of Application Architecture
How to Speak the Language of Application ArchitectureHow to Speak the Language of Application Architecture
How to Speak the Language of Application Architecture
Brad Beiermann
 
design-concept.ppt
design-concept.pptdesign-concept.ppt
design-concept.ppt
MangeshKetkar1
 
UI5con 2018 - Keynote
UI5con 2018 - KeynoteUI5con 2018 - Keynote
UI5con 2018 - Keynote
Peter Muessig
 
Agile Modeling using the Architecture Tools in VS 2010
Agile Modeling  using the Architecture Tools in VS 2010Agile Modeling  using the Architecture Tools in VS 2010
Agile Modeling using the Architecture Tools in VS 2010
Gary Pedretti
 
Introduction to Configurator 2.0 architecture design
Introduction to Configurator 2.0 architecture designIntroduction to Configurator 2.0 architecture design
Introduction to Configurator 2.0 architecture design
Xiaoyan Chen
 

Similar to Software Design (20)

The Language of Application Architecture
The Language of Application ArchitectureThe Language of Application Architecture
The Language of Application Architecture
 
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
 
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
 
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...Software Factories in the Real World: How an IBM WebSphere Integration Factor...
Software Factories in the Real World: How an IBM WebSphere Integration Factor...
 
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
Sioux Hot-or-Not: Model Driven Software Development (Markus Voelter)
 
Object Oriented System Design
Object Oriented System DesignObject Oriented System Design
Object Oriented System Design
 
Design concepts and principle,
Design concepts and principle, Design concepts and principle,
Design concepts and principle,
 
VS Code and Modern Development Environment Preview
VS Code and Modern Development Environment PreviewVS Code and Modern Development Environment Preview
VS Code and Modern Development Environment Preview
 
Modular Enterprise Systems - An Introduction
Modular Enterprise Systems - An IntroductionModular Enterprise Systems - An Introduction
Modular Enterprise Systems - An Introduction
 
AutoDesk Inventor Professional-2018
AutoDesk Inventor Professional-2018AutoDesk Inventor Professional-2018
AutoDesk Inventor Professional-2018
 
Customer Centric View of Best Practices in Software Monetization
Customer Centric View of Best Practices in Software MonetizationCustomer Centric View of Best Practices in Software Monetization
Customer Centric View of Best Practices in Software Monetization
 
Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12Introducing a Software Generator Framework - JAZOON12
Introducing a Software Generator Framework - JAZOON12
 
Eclipse Summit 2008 - Thales - SolFa
Eclipse Summit 2008 - Thales - SolFaEclipse Summit 2008 - Thales - SolFa
Eclipse Summit 2008 - Thales - SolFa
 
Design techniques
Design techniquesDesign techniques
Design techniques
 
Next Generation Component Management - Altium Designer
Next Generation Component Management - Altium DesignerNext Generation Component Management - Altium Designer
Next Generation Component Management - Altium Designer
 
How to Speak the Language of Application Architecture
How to Speak the Language of Application ArchitectureHow to Speak the Language of Application Architecture
How to Speak the Language of Application Architecture
 
design-concept.ppt
design-concept.pptdesign-concept.ppt
design-concept.ppt
 
UI5con 2018 - Keynote
UI5con 2018 - KeynoteUI5con 2018 - Keynote
UI5con 2018 - Keynote
 
Agile Modeling using the Architecture Tools in VS 2010
Agile Modeling  using the Architecture Tools in VS 2010Agile Modeling  using the Architecture Tools in VS 2010
Agile Modeling using the Architecture Tools in VS 2010
 
Introduction to Configurator 2.0 architecture design
Introduction to Configurator 2.0 architecture designIntroduction to Configurator 2.0 architecture design
Introduction to Configurator 2.0 architecture design
 

Recently uploaded

Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 

Recently uploaded (20)

Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 

Software Design

  • 1. MODULE:VMODULE:V SOFTWARE DESIGNSOFTWARE DESIGN Namita PandaNamita Panda School of Computer EngineeringSchool of Computer Engineering KIIT Deemed to be UniversityKIIT Deemed to be University 01/25/1901/25/19 11MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN
  • 2. Software Design  Design phase transformsDesign phase transforms SRS documentSRS document intointo thethe design documentdesign document..  TheThe design documentdesign document produced at the end ofproduced at the end of the design phase should bethe design phase should be implementableimplementable using a programming languageusing a programming language in the codingin the coding phase.phase. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 22
  • 3. Software Design 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 33
  • 4. Items Designed During Design PhaseItems Designed During Design Phase  DifferentDifferent modulesmodules  Control relationshipControl relationship (call/invocation(call/invocation relationship) among modulesrelationship) among modules  Interface among moduleInterface among modules(data itemss(data items exchanged among different modules)exchanged among different modules)  Data structureData structure of individual modulesof individual modules  Algorithm requiredAlgorithm required to implement individualto implement individual module.module. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 44
  • 5. Software DesignSoftware Design 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 55
  • 6. Software DesignSoftware Design  A module consists of:A module consists of: --several functions--several functions --associated data structures.--associated data structures. AA High Level DesignHigh Level Design identify…identify…  ModulesModules  control relationships among modulescontrol relationships among modules  interfaces among modules.interfaces among modules. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 66
  • 7. Software DesignSoftware Design  Several notations are available to representSeveral notations are available to represent high-level design:high-level design:  Usually a tree-like diagram calledUsually a tree-like diagram called structurestructure chartchart is used.is used. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 77
  • 8. Software DesignSoftware Design  Detailed designDetailed design For each module, design:For each module, design: --data structure--data structure --algorithms--algorithms 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 88
  • 9. Attributes of a good software designAttributes of a good software design  CorrectnessCorrectness  Should correctly implement all the functionalities ofShould correctly implement all the functionalities of the system.the system.  UnderstandabilityUnderstandability  Easily understandableEasily understandable  EfficiencyEfficiency -- A good design solution should adequately address-- A good design solution should adequately address resource ,time and cost optimization issues.resource ,time and cost optimization issues.  MaintainabilityMaintainability  Easily amenable to changeEasily amenable to change 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 99
  • 10. Goals of a good designGoals of a good design  Three characteristics that serves as aThree characteristics that serves as a guideguide for thefor the evaluation of a good design:evaluation of a good design:  Design mustDesign must o Implement all theImplement all the explicit requirementsexplicit requirements o Accommodate all theAccommodate all the implicit requirementsimplicit requirements  Design must beDesign must be o ReadableReadable o Understandable guideUnderstandable guide for those who generate the code, whofor those who generate the code, who test and who support the softwaretest and who support the software  Design should provide a complete picture of the software,Design should provide a complete picture of the software, addressingaddressing datadata,, functionsfunctions, and, and behavioral domainbehavioral domain fromfrom an implementation perspective.an implementation perspective. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1010
  • 11. UnderstandabilityUnderstandability  Unless a design is easy to understand,Unless a design is easy to understand, tremendoustremendous efforteffort needed to maintain it.needed to maintain it.  We already know that aboutWe already know that about 60%60% efforteffort is spent inis spent in maintenance.maintenance.  If the software is not easy to understand:If the software is not easy to understand: maintenance effort would increase manymaintenance effort would increase many times.times. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1111
  • 12. UnderstandabilityUnderstandability  Use consistent and meaningful namesUse consistent and meaningful names for various design components.for various design components.  Design solution should consist of: aDesign solution should consist of: a cleanlycleanly decomposeddecomposed set of modules (modularity).set of modules (modularity).  Different modules should be neatly arranged inDifferent modules should be neatly arranged in a hierarchy: in a neat tree-like diagram.a hierarchy: in a neat tree-like diagram. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1212
  • 13. ModularityModularity  Modularity is a fundamental attribute of anyModularity is a fundamental attribute of any good design.good design.  Decomposition of a problemDecomposition of a problem cleanly intocleanly into modules facilitates the design by takingmodules facilitates the design by taking advantage of theadvantage of the divide and conquerdivide and conquer principle.principle. -Modules are almost-Modules are almost independentindependent of eachof each other.other. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1313
  • 14. Example of Cleanly and Non cleanlyExample of Cleanly and Non cleanly Decomposed ModulesDecomposed Modules 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1414
  • 15. Modularity…Modularity… Neat arrangement of modules in a hierarchyNeat arrangement of modules in a hierarchy means:means:  low fan-outlow fan-out  abstractionabstraction 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1515
  • 16. Modularity…Modularity…  If modules are independent:If modules are independent: - modules can be- modules can be understoodunderstood separately,separately,  To understand why this is so,To understand why this is so,  remember that it is very difficult to break aremember that it is very difficult to break a bunch of sticks but very easy to break thebunch of sticks but very easy to break the sticks individually.sticks individually. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1616
  • 17. Modularity…Modularity…  ReducesReduces complexitycomplexity  FacilitateFacilitate changeschanges  Results in easier implementations byResults in easier implementations by encouragingencouraging parallel developmentparallel development of different parts of a system.of different parts of a system. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1717
  • 19. Functional IndependenceFunctional Independence Benifits:Benifits:  Better understandabilityBetter understandability and good design:and good design:  Complexity of design is reducedComplexity of design is reduced,,  Different modulesDifferent modules easily understood ineasily understood in isolationisolation::  Since different modules are independentSince different modules are independent 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 1919
  • 20. Functional Independence...Functional Independence...  Functional independenceFunctional independence reduces errorreduces error propagationpropagation..  degree of interaction between modules isdegree of interaction between modules is low.low.  an error existing in one module does notan error existing in one module does not directly affect other modules.directly affect other modules.  Reuse of modulesReuse of modules is possible.is possible. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2020
  • 21. Modularity…Modularity…  In technical terms, modules shouldIn technical terms, modules should display:display: ----high cohesionhigh cohesion ----low coupling.low coupling. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2121
  • 22. Cohesion and CouplingCohesion and Coupling  Cohesion is a measure of:Cohesion is a measure of:  functional strengthfunctional strength of a module.of a module.  A cohesive moduleA cohesive module performs a single task orperforms a single task or functionfunction..  Coupling between two modules:Coupling between two modules:  a measure of thea measure of the degree of interdependencedegree of interdependence or interaction between the two modulesor interaction between the two modules.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2222
  • 23. Classification of CohesivenessClassification of Cohesiveness Classification is often subjective: yet gives usClassification is often subjective: yet gives us some idea about cohesiveness of a module.some idea about cohesiveness of a module.  By examining theBy examining the type of cohesiontype of cohesion exhibitedexhibited by a module:by a module: we can roughly tell whether it displays highwe can roughly tell whether it displays high cohesion or low cohesioncohesion or low cohesion 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2323
  • 24. Classification of CohesivenessClassification of Cohesiveness 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2424
  • 25. Coincidental CohesionCoincidental Cohesion  The module performs aThe module performs a set of tasks whichset of tasks which relate to each other very looselyrelate to each other very loosely..  Data elements or instructions within moduleData elements or instructions within module havehave no relationno relation to each other.to each other.  the module contains athe module contains a random collectionrandom collection ofof functions.functions.  functions have been put in the module out of purefunctions have been put in the module out of pure coincidence without any thought or design.coincidence without any thought or design. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2525
  • 26.  Example:(Example:(Coincidental Cohesion)Coincidental Cohesion) FILE PROCESSINGFILE PROCESSING OPEN EMPLOYEE UPDATE FILEOPEN EMPLOYEE UPDATE FILE READ EMPLOYEE RECREAD EMPLOYEE REC PRINT_PAGE_HEADINGPRINT_PAGE_HEADING OPEN MASTER FILE(EMPLOYEE)OPEN MASTER FILE(EMPLOYEE) SET PAGE_COUNT TO 1SET PAGE_COUNT TO 1 SET ERR_FLAG TO FALSESET ERR_FLAG TO FALSE ENDEND 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2626
  • 27. Logical cohesionLogical cohesion  All elements of the module perform similarAll elements of the module perform similar operations:operations:  e.g. error handling, data input, data output,e.g. error handling, data input, data output, etc.etc.  Components are logically related to eachComponents are logically related to each other.other.  Modules which contains routines to supportModules which contains routines to support different types of input.different types of input. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2727
  • 28.  Example(Example(Logical CohesionLogical Cohesion)) READ_ALL_FILESREAD_ALL_FILES CASE OF FILE_CODECASE OF FILE_CODE 1:READ CUST_TRAN REC1:READ CUST_TRAN REC IF NOT EOFIF NOT EOF INCREMENT_TRAN_COUNTINCREMENT_TRAN_COUNT ENDIFENDIF 2:READ CUST_MASTER REC2:READ CUST_MASTER REC IF NOT EOFIF NOT EOF INCREMENT CUST_MASTER_COUNTINCREMENT CUST_MASTER_COUNT ENDIFENDIF 3:READ PRODUCT_MASTER REC3:READ PRODUCT_MASTER REC IF NOT EOFIF NOT EOF INCREMENT PRODUCT_MASTER_COUNTINCREMENT PRODUCT_MASTER_COUNT ENDIFENDIF ENDCASEENDCASE ENDEND 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2828
  • 29. Temporal cohesionTemporal cohesion  The module contains tasks that are related by theThe module contains tasks that are related by the fact thatfact that all the tasks must be executed in the sameall the tasks must be executed in the same time span.time span.  Example:Example:  Cancel all tasksCancel all tasks  Cancel all windowsCancel all windows  Cancel all data filesCancel all data files  Shuts down the machinesShuts down the machines  These tasks which are not logically or functionally relatedThese tasks which are not logically or functionally related to each other, but takes place when ato each other, but takes place when a failurefailure occurs.occurs. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 2929
  • 30.  Example(Example(Temporal cohesion)Temporal cohesion) INITIALIZATIONINITIALIZATION OPEN TRAN_FILEOPEN TRAN_FILE ISSUE PROMPT ‘ENTER DATE’ISSUE PROMPT ‘ENTER DATE’ READ TODAYS_DATEREAD TODAYS_DATE SET TRAN_COUNT TO ZEROSET TRAN_COUNT TO ZERO SET REPORT_TOTAL TO ZEROSET REPORT_TOTAL TO ZERO OPEN REPORT_FILEOPEN REPORT_FILE ENDEND 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3030
  • 31. Procedural cohesionProcedural cohesion  The set of functions of the module:The set of functions of the module: all part of a procedure (algorithm)all part of a procedure (algorithm)  certain sequence of steps have to be carriedcertain sequence of steps have to be carried out in a certain order for achieving anout in a certain order for achieving an objective.objective. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3131
  • 32.  Example(Example(Procedural cohesion)Procedural cohesion) READ STUD_REC AND TOTAL_STUD_AGESREAD STUD_REC AND TOTAL_STUD_AGES NO_OF_REC=0NO_OF_REC=0 TOTAL_AGE=0TOTAL_AGE=0 READ STUD_RECREAD STUD_REC DO WHILE MORE_REC_EXISTDO WHILE MORE_REC_EXIST ADD AGE TO TOTAL_AGEADD AGE TO TOTAL_AGE ADD 1 TO NO_OF_RECADD 1 TO NO_OF_REC READ STUD_RECREAD STUD_REC ENDDOENDDO ENDEND 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3232
  • 33. Communicational cohesionCommunicational cohesion All functions of the moduleAll functions of the module reference or updatereference or update the same data structure.the same data structure.  Different outputs are generated on same inputDifferent outputs are generated on same input  i.e.i.e. Communicational cohesionCommunicational cohesion occurs when twooccurs when two operationsoperations share common datashare common data, but are otherwise, but are otherwise unrelated.unrelated. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3333
  • 34.  Example(Example(Communicational cohesion)Communicational cohesion) PROCEDURE ERR_REPORTPROCEDURE ERR_REPORT VALIDATEVALIDATE PRODUCT_RECPRODUCT_REC IFIF TRAN_TYPETRAN_TYPE NOT=0 THENNOT=0 THEN WRITE_ERR_REPORTWRITE_ERR_REPORT ENDIFENDIF IFIF CUST_NOCUST_NO NOT NUMERIC THENNOT NUMERIC THEN WRITE ERR REPORTWRITE ERR REPORT ENDIFENDIF IFIF PRODUCT_NOPRODUCT_NO=BLANKS=BLANKS WRITE ERR REPORTWRITE ERR REPORT ENDIFENDIF ENDEND 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3434
  • 35. Sequential cohesionSequential cohesion  Elements of a moduleElements of a module form different parts of aform different parts of a sequencesequence, i.e., the output from one element of the, i.e., the output from one element of the sequence is input to the next.sequence is input to the next.  Example-1Example-1 Example-2Example-2 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3535
  • 36.  Example(Example(Sequential cohesionSequential cohesion)) PROCESS PURCHASESPROCESS PURCHASES TOTAL_PURCHASE=0TOTAL_PURCHASE=0 READ NO_OF_PURCHASESREAD NO_OF_PURCHASES DO LOOP_INDEX=1 TO NO_OF_PURCHASESDO LOOP_INDEX=1 TO NO_OF_PURCHASES GET PURCHASESGET PURCHASES ADD PURCHASES TOADD PURCHASES TO TOTAL_PURCHASESTOTAL_PURCHASES ENDDOENDDO SALES_TAXSALES_TAX==TOTAL_PURCHASESTOTAL_PURCHASES*SALE_TAX_PERCENT*SALE_TAX_PERCENT AMT_DUE=TOTAL_PURCHASES+AMT_DUE=TOTAL_PURCHASES+SALES_TAXSALES_TAX ENDEND 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3636
  • 37. Functional cohesionFunctional cohesion  Different elements of a moduleDifferent elements of a module cooperate tocooperate to achieve a single functionachieve a single function,,  A simple example ofA simple example of functional cohesionfunctional cohesion is a math function.is a math function. Pick any of them, sin(), cos (), or atan ()Pick any of them, sin(), cos (), or atan () 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3737
  • 38.  Example(Example(Functional cohesion)Functional cohesion) CALCULATE_SALES_TAXCALCULATE_SALES_TAX IF PRODUCT IS SALES_TAX EXEMPT THENIF PRODUCT IS SALES_TAX EXEMPT THEN SALES_TAX=0SALES_TAX=0 ELSEELSE IF PRODUCT_PRICE<$50 THENIF PRODUCT_PRICE<$50 THEN SALES_TAX=PRODUCT_PRICE*0.25SALES_TAX=PRODUCT_PRICE*0.25 ENDIFENDIF ENDIFENDIF 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3838
  • 39. CouplingCoupling  Coupling indicates:Coupling indicates:  howhow closely two modules interactclosely two modules interact oror howhow interdependent they areinterdependent they are..  The degree of coupling between twoThe degree of coupling between two modules depends on their interfacemodules depends on their interface complexity.complexity. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 3939
  • 40. Classes of couplingClasses of coupling 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4040
  • 41. Data couplingData coupling  Two modules are data coupled,Two modules are data coupled, if theyif they communicate via an elementary data item,communicate via an elementary data item, ---e.g. an integer, a float, a character, etc.---e.g. an integer, a float, a character, etc.  The data item should beThe data item should be problem relatedproblem related,, but not used for control purpose.but not used for control purpose. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4141
  • 42. Stamp couplingStamp coupling  Two modules areTwo modules are stamp coupledstamp coupled,, if theyif they communicate via acommunicate via a composite data itemcomposite data item..  such as a record in PASCALsuch as a record in PASCAL  or a structure in C.or a structure in C. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4242
  • 43.  Control couplingControl coupling  Data from one module is used to direct theData from one module is used to direct the order oforder of instruction execution in another.instruction execution in another.  Example of control coupling:Example of control coupling:  a flag set in one module and tested in another module.a flag set in one module and tested in another module.  Common CouplingCommon Coupling  Two modules areTwo modules are common coupledcommon coupled,, if they share someif they share some global data.global data.  Content couplingContent coupling  Content coupling exists between two modulesContent coupling exists between two modules share code,share code,  e. g, branching from one module into anothere. g, branching from one module into another module.module.  When customer not found, component calls theWhen customer not found, component calls the AddCustomer( ) method that is responsible forAddCustomer( ) method that is responsible for maintaining customer data.maintaining customer data. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4343
  • 44. Characteristics of ModuleCharacteristics of Module StructureStructure  DepthDepth :number of levels of control:number of levels of control  Width:Width: overall span of control.overall span of control.  Fan-out:Fan-out: a measure of the number of modulesa measure of the number of modules directly controlled by given module.directly controlled by given module.  Fan-in:Fan-in: indicates how many modules directlyindicates how many modules directly invoke a given module.invoke a given module.  High fan-in representsHigh fan-in represents code reusecode reuse and is inand is in general encouraged.general encouraged. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4444
  • 45. Fan-in & Fan-outFan-in & Fan-out 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4545
  • 46.  A design having modules:A design having modules: withwith high fan-outhigh fan-out numbersnumbers is not a goodis not a good design:design:  a module having high fan-outa module having high fan-out lacks cohesionlacks cohesion.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4646
  • 47. Visibility and LayeringVisibility and Layering  A module A is said to beA module A is said to be visiblevisible by anotherby another module B, if A directly or indirectly calls B.module B, if A directly or indirectly calls B.  TheThe layeringlayering principle requires modules at aprinciple requires modules at a layerlayer can call onlycan call only the modules immediatelythe modules immediately below it.below it. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4747
  • 48. AbstractionAbstraction  Lower-level modulesLower-level modules:: do input/output and other low-level functions.do input/output and other low-level functions.  Upper-level modulesUpper-level modules:: do more managerial functions.do more managerial functions.  The principle of abstraction requires:The principle of abstraction requires: lower-level modules do not invoke functionslower-level modules do not invoke functions of higher level modulesof higher level modules..  Also known asAlso known as layered design.layered design. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4848
  • 49. Design Concepts & PrinciplesDesign Concepts & Principles 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 4949
  • 50.  DFD serves two purposes:DFD serves two purposes:  Provides an indication ofProvides an indication of how data are transformedhow data are transformed as they move through the systemas they move through the system  To depict theTo depict the functions (& sub-functions)functions (& sub-functions) thatthat transform the data flow.transform the data flow.  AA description of each functiondescription of each function presented in thepresented in the DFD is contained in a processes specificationDFD is contained in a processes specification ((PSPECPSPEC).). 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5050
  • 51.  STD indicatesSTD indicates how system behaves as ahow system behaves as a consequence of external eventsconsequence of external events. It represents. It represents various modes of behavior (state)various modes of behavior (state) of theof the system & thesystem & the manner in which transitions aremanner in which transitions are mademade from state to state.from state to state.  Additional information about the controlAdditional information about the control aspects of the software is contained in theaspects of the software is contained in the control specificationscontrol specifications (CSPEC)(CSPEC) 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5151
  • 52.  TheThe attributesattributes of each data objects noted in the ERof each data objects noted in the ER diagram can be described usingdiagram can be described using data objectdata object descriptiondescription..  Data DesignData Design  Transforms theTransforms the information domaininformation domain model createdmodel created during analysis into theduring analysis into the data structuredata structure that will bethat will be required to implement the software.required to implement the software.  TheThe data objectsdata objects and the relationships defined in theand the relationships defined in the ER diagramER diagram and theand the detailed data contentsdetailed data contents depicted indepicted in data dictionary provides the basis for the data designdata dictionary provides the basis for the data design activity.activity.  Part of the designPart of the design occurs in conjunction with theoccurs in conjunction with the designdesign of s/w architectureof s/w architecture andand more detailed data designmore detailed data design occurs asoccurs as each s/w component is designed.each s/w component is designed. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5252
  • 53.  Architectural DesignArchitectural Design  Defines theDefines the relationships between majorrelationships between major structural elementsstructural elements..  Can be derived from theCan be derived from the system specification, thesystem specification, the analysis model and the interactions ofanalysis model and the interactions of subsystemssubsystems..  Interface DesignInterface Design  Describes how theDescribes how the software communicatessoftware communicates within itself, with the system that interoperatewithin itself, with the system that interoperate with it and with humans who use it.with it and with humans who use it. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5353
  • 54.  Component Level DesignComponent Level Design  TransformsTransforms structural elementsstructural elements of the softwareof the software architecture intoarchitecture into procedural description of softwareprocedural description of software component.component.  Information obtained from PSPEC, CSPEC, &Information obtained from PSPEC, CSPEC, & STD serves as basis for component design.STD serves as basis for component design.  Software design serves as the foundation forSoftware design serves as the foundation for all the software engineering and softwareall the software engineering and software support steps that follow.support steps that follow. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5454
  • 55. Design Concepts…Design Concepts…  AA set of fundamental software design conceptsset of fundamental software design concepts has evolvedhas evolved over past four decades. Each provides the software designerover past four decades. Each provides the software designer with a foundation from which more sophisticated designwith a foundation from which more sophisticated design methods can be applied.methods can be applied. 1.1. ABSTRACTIONABSTRACTION 2.2. REFINEMENTREFINEMENT 3.3. MODULARITYMODULARITY 4.4. SOFTWARE ARCHITECTURESOFTWARE ARCHITECTURE 5.5. CONTROL HIERARCHYCONTROL HIERARCHY 6.6. STRUCTURAL PARTITIONINGSTRUCTURAL PARTITIONING 7.7. DATA STRUCTUREDATA STRUCTURE 8.8. SOFTWARE PROCEDURESOFTWARE PROCEDURE 9.9. INFORMATION HIDINGINFORMATION HIDING 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5555
  • 56. AbstractionAbstraction 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5656
  • 57.  Procedural AbstractionProcedural Abstraction  It is a namedIt is a named sequence of instructionssequence of instructions that has athat has a specific and limited function.specific and limited function.  E.g.E.g. OPEN A DOOROPEN A DOOR is a long sequence ofis a long sequence of procedural stepsprocedural steps 1. walk to the door 2. Reach out and grasp the knob 3. Turn knob & pull door 4. Step away from moving door etc. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5757
  • 58.  Data AbstractionData Abstraction  Is a namedIs a named collection of datacollection of data describes a datadescribes a data objectobject  E.g.E.g. DOORDOOR; The attributes are; The attributes are 1.1. Door typeDoor type 2.2. Swing directionSwing direction 3.3. Opening mechanismOpening mechanism 4.4. WeightWeight 5.5. Dimension etc.Dimension etc. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5858
  • 59.  Control AbstractionControl Abstraction It implies aIt implies a program control mechanism withoutprogram control mechanism without specifying internal detailsspecifying internal details  e.g.e.g.Thread managementThread management in a multithreadingin a multithreading environmentenvironment 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 5959
  • 60. RefinementRefinement -It is the-It is the top down designtop down design strategy.strategy. -In each step(of refinement), one or several-In each step(of refinement), one or several instructions of the given program areinstructions of the given program are decomposed into more detail instructions.decomposed into more detail instructions. -Refinement is actually a-Refinement is actually a process of elaboration.process of elaboration. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6060
  • 61. ArchitectureArchitecture  Architecture is theArchitecture is the hierarchical structure of ahierarchical structure of a program components (modules)program components (modules), the manner in, the manner in which thesewhich these components interactcomponents interact and theand the structure of datastructure of data that are used by thethat are used by the component.component. -- Client Server Architecture-- Client Server Architecture -- Main program/Subprogram Architecture-- Main program/Subprogram Architecture -- Layered Architecture(core layer, utility layer,-- Layered Architecture(core layer, utility layer, application layer, user interface layer)application layer, user interface layer) 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6161
  • 62. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6262
  • 63. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6363
  • 64. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6464
  • 65. Control HierarchyControl Hierarchy (program structure)(program structure)  It represents theIt represents the organization of the programorganization of the program components (modules)components (modules) and implies aand implies a hierarchyhierarchy of controlof control..  ItIt does not represents the procedural aspectdoes not represents the procedural aspect ofof software.software. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6565
  • 66. Control HierarchyControl Hierarchy CONT…CONT… 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6666
  • 67. Structural partitioningStructural partitioning  For aFor a hierarchical style of architecturehierarchical style of architecture the programthe program module can be partitioned into:module can be partitioned into:  HorizontalHorizontal  VerticalVertical  Horizontal partitioningHorizontal partitioning defines separate branches of the modulardefines separate branches of the modular hierarchy for each major program function.hierarchy for each major program function. Simplest way is to partition a system into:Simplest way is to partition a system into: input, datainput, data transformation (processing), and output.transformation (processing), and output. AdvantagesAdvantages of horizontal partition:of horizontal partition: -- easy to test, maintain, and extendeasy to test, maintain, and extend - fewer side effects in change propagation or error propagation- fewer side effects in change propagation or error propagation Disadvantage:Disadvantage: more data to be passed across module interfaces -more data to be passed across module interfaces - complicate the overall control of program flowcomplicate the overall control of program flow 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6767
  • 68.  Vertical partitioningVertical partitioning suggests the control andsuggests the control and work should be distributed top-down inwork should be distributed top-down in program structure.program structure. Advantages:Advantages: - good at dealing with changes:- good at dealing with changes: - easy to maintain the changes- easy to maintain the changes - reduce the change impact and and- reduce the change impact and and propagationpropagation 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6868
  • 69. Data StructureData Structure  Represents theRepresents the logical relationshiplogical relationship among individualamong individual elements of data.elements of data.  It indicates theIt indicates the  Organization of dataOrganization of data  Method of accessMethod of access  Degree of associativenessDegree of associativeness  Process alternatives for informationProcess alternatives for information 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 6969
  • 70. Software ProcedureSoftware Procedure  Program structure define control hierarchy withoutProgram structure define control hierarchy without regard to the sequence of processing and decision.regard to the sequence of processing and decision.  SoftwareSoftware focuses on the processing details of eachfocuses on the processing details of each module individually.module individually.  Procedure must provide a precise specification ofProcedure must provide a precise specification of processing includingprocessing including  Sequence of eventsSequence of events  Exact decision pointsExact decision points  Repetitive operations, data organization and structureRepetitive operations, data organization and structure 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7070
  • 71. Information HidingInformation Hiding  Modules be characterized by design decisionModules be characterized by design decision thatthat each module hides from all otherseach module hides from all others..  i.e. information (i.e. information (data & proceduredata & procedure) contained) contained within a module is inaccessible to otherwithin a module is inaccessible to other modulesmodules that have no need for suchthat have no need for such information.information. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7171
  • 72. Structured AnalysisStructured Analysis  Transforms a textual problem description intoTransforms a textual problem description into a graphic model.a graphic model. –– Done usingDone using DDataata FFlowlow DDiagramsiagrams (DFDs).(DFDs).  –– DFDs graphically represent the results ofDFDs graphically represent the results of structured analysis.structured analysis. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7272
  • 73.  DFD is an elegant modeling technique:DFD is an elegant modeling technique:  –– Useful not only to represent the results ofUseful not only to represent the results of structured analysis.structured analysis.  –– Applicable to other areas also:Applicable to other areas also: e.g. for showing thee.g. for showing the flow of documentsflow of documents oror itemsitems in an organization,in an organization,  DFD technique is very popular:DFD technique is very popular: –– It is powerful and yet simple to understandIt is powerful and yet simple to understand and use.and use. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7373
  • 74.  DFD is aDFD is a hierarchical graphical modelhierarchical graphical model::  –– Shows the differentShows the different functionsfunctions (or(or processesprocesses)) of the system andof the system and  –– Data interchangeData interchange among the processes.among the processes. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7474
  • 75. It is useful to consider each function as aIt is useful to consider each function as a processing station:processing station:  ––Each functionEach function consumesconsumes somesome input datainput data..  ––ProducesProduces somesome output data.output data. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7575
  • 76.  Data Flow Model of a Car Assembly UnitData Flow Model of a Car Assembly Unit 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7676
  • 77.  A DFD model:A DFD model: –– UsesUses limited types of symbols.limited types of symbols. –– Simple set of rulesSimple set of rules –– Easy to understand:Easy to understand: It is aIt is a hierarchicalhierarchical model.model. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7777
  • 78.  Primitive Symbols Used for ConstructingPrimitive Symbols Used for Constructing DFDs:DFDs: 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7878
  • 79. External Entity SymbolExternal Entity Symbol  Represented by a rectangleRepresented by a rectangle  External entities are real physical entities:External entities are real physical entities: –– input data to the system orinput data to the system or –– consume data produced by the system.consume data produced by the system. –– Sometimes external entities are calledSometimes external entities are called terminator, source, or sink.terminator, source, or sink. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 7979
  • 80. Function SymbolFunction Symbol  A function such as “A function such as “search-booksearch-book” is” is represented using a circle:represented using a circle:  –– This symbol is called aThis symbol is called a processprocess oror bubblebubble oror transform.transform.  –– Bubbles are annotated with correspondingBubbles are annotated with corresponding function names.function names.  –– Functions represent some activity:Functions represent some activity:  FunctionFunction namesnames should beshould be verbsverbs.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8080
  • 81. Data Flow SymbolData Flow Symbol  A directed arc or line.A directed arc or line.  –– RepresentsRepresents data flowdata flow in the direction of thein the direction of the arrow.arrow.  –– Data flow symbols are annotated with namesData flow symbols are annotated with names of data they carry.of data they carry. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8181
  • 82. Data Store SymbolData Store Symbol  Represents a logical file:Represents a logical file:  –– A logical file can be:A logical file can be: -- a data structurea data structure -- a physical file on disk.a physical file on disk.  –– Each data store is connected to a process:Each data store is connected to a process: by means of a data flow symbol.by means of a data flow symbol. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8282
  • 83.  Direction of data flow arrow:Direction of data flow arrow: –– Shows whether data is beingShows whether data is being read fromread from oror written intowritten into it.it.  An arrow into or out of a data storeAn arrow into or out of a data store –– ImplicitlyImplicitly represents the entire data of therepresents the entire data of the data storedata store  –– Arrows connecting to a data store need notArrows connecting to a data store need not be annotated with any data name.be annotated with any data name. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8383
  • 84. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8484
  • 85. Output SymbolOutput Symbol  Output produced by the systemOutput produced by the system 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8585
  • 86. Synchronous OperationSynchronous Operation  If two bubbles are directly connected by a dataIf two bubbles are directly connected by a data flow arrow: they areflow arrow: they are synchronoussynchronous.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8686
  • 87. Asynchronous OperationAsynchronous Operation  If two bubbles are connected via a data store:If two bubbles are connected via a data store: they are not synchronous.they are not synchronous. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8787
  • 88.  Initially represent the software at theInitially represent the software at the mostmost abstractabstract level:level: –– Called theCalled the context diagramcontext diagram..  –– The entire system is represented asThe entire system is represented as aa single bubblesingle bubble,,  –– This bubble isThis bubble is labeledlabeled according to theaccording to the mainmain functionfunction of the system.of the system. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8888
  • 89. Tic-tac-toe: Context DiagramTic-tac-toe: Context Diagram 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 8989
  • 90.  AA context diagramcontext diagram shows:shows: ––DataData inputinput to the system,to the system, ––Output data generated by the system,Output data generated by the system, ––External entitiesExternal entities 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9090
  • 91.  Context diagramContext diagram captures:captures: –– Various entities external to the systemVarious entities external to the system and interacting with it.and interacting with it. –– Data flow occurring between the system andData flow occurring between the system and the external entitiesthe external entities..  The context diagram is also called as theThe context diagram is also called as the levellevel 0 DFD.0 DFD. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9191
  • 92.  Context Diagram Establishes the context of theContext Diagram Establishes the context of the system, i.e.system, i.e. ––Represents:Represents: Data sourcesData sources Data sinks.Data sinks. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9292
  • 93. Level 1 DFDLevel 1 DFD Examine the SRS document:Examine the SRS document:  –– Represent each high-levelRepresent each high-level function as afunction as a bubblebubble..  –– RepresentRepresent data inputdata input to every high levelto every high level function.function.  –– RepresentRepresent data outputdata output from everyfrom every high-level function.high-level function. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9393
  • 94. Higher Level DFDsHigher Level DFDs  Each high-level function is separatelyEach high-level function is separately decomposed intodecomposed into sub functionssub functions:: –– Identify the sub-functions of the functionIdentify the sub-functions of the function –– Identify the data input to each sub-functionIdentify the data input to each sub-function –– Identify the data output from each sub-Identify the data output from each sub- functionfunction  These are represented as DFDs.These are represented as DFDs. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9494
  • 95. Decomposition of a bubble:Decomposition of a bubble: –– Also calledAlso called factoringfactoring oror explodingexploding..  Each bubble is decomposed toEach bubble is decomposed to –– BetweenBetween 33 toto 77 bubbles.bubbles. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9595
  • 96. Example 1: RMS CalculatingExample 1: RMS Calculating SoftwareSoftware  Consider a software calledConsider a software called RMS calculatingRMS calculating software:software:  –– ReadsReads three integers in the range ofthree integers in the range of - 1000- 1000 and +1000and +1000  –– Finds outFinds out thethe root mean squareroot mean square (rms) of(rms) of the three input numbersthe three input numbers  –– Displays the resultDisplays the result.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9696
  • 97. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9797
  • 98.  Accept input numbers from the user:Accept input numbers from the user: –– ValidateValidate the numbers,the numbers, –– CalculateCalculate the root mean square of the inputthe root mean square of the input numbersnumbers –– DisplayDisplay the result.the result. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9898
  • 99. Level 1 DFD for RMS SoftwareLevel 1 DFD for RMS Software 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 9999
  • 100. Level 2 DFD for RMS SoftwareLevel 2 DFD for RMS Software 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 100100
  • 101. Level 3 DFD for RMS SoftwareLevel 3 DFD for RMS Software 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 101101
  • 102.  Decomposition is never carried on up to basicDecomposition is never carried on up to basic instruction level:instruction level: –– A bubble is not decomposed any further:A bubble is not decomposed any further:  If it can be represented by a simple set ofIf it can be represented by a simple set of instructionsinstructions 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 102102
  • 103. Balancing a DFDBalancing a DFD  Data flowing into or out of a bubble:Data flowing into or out of a bubble:  –– Must match the data flows at the next levelMust match the data flows at the next level of DFD. In the level 1 of the DFD,of DFD. In the level 1 of the DFD,  –– Data item c flows into the bubble P3 and theData item c flows into the bubble P3 and the data item d and e flow out.data item d and e flow out.  ●● In the next level, bubble P3 is decomposed.In the next level, bubble P3 is decomposed.  –– The decomposition is balanced as data item cThe decomposition is balanced as data item c flows into the level 2 diagram and d and e flowflows into the level 2 diagram and d and e flow out.out. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 103103
  • 104. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 104104
  • 105.  Number the bubbles in a DFD:Number the bubbles in a DFD:  –– Numbers help inNumbers help in uniquely identifyinguniquely identifying anyany bubble from its bubble number.bubble from its bubble number.  The bubble at context level: Assigned number 0.The bubble at context level: Assigned number 0.  Bubbles at level 1:Bubbles at level 1: – Numbered– Numbered 0.1, 0.2,0.1, 0.2, etc.etc.  When a bubble numberedWhen a bubble numbered x is decomposedx is decomposed,,  –– Its children bubble are numberedIts children bubble are numbered x.1, x.2, x.3,x.1, x.2, x.3, etc.etc. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 105105
  • 106. Data DictionaryData Dictionary  A DFD is always accompanied by a data dictionary.A DFD is always accompanied by a data dictionary.  A data dictionary lists all data items appearing in aA data dictionary lists all data items appearing in a DFD:DFD:  Definition of all composite data items in terms ofDefinition of all composite data items in terms of their component data items.their component data items.  All data names along with the purpose of the dataAll data names along with the purpose of the data items.items.  For example, a data dictionary entry may be:For example, a data dictionary entry may be:  grossPay = regularPay+overtimePaygrossPay = regularPay+overtimePay 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 106106
  • 107. Importance of Data DictionaryImportance of Data Dictionary  Provides all engineers in a project withProvides all engineers in a project with standard terminologystandard terminology for all data:for all data:  –– AA consistentconsistent vocabulary for data is veryvocabulary for data is very importantimportant  –– Different engineers tend to use differentDifferent engineers tend to use different terms to refer to the same data, Causesterms to refer to the same data, Causes unnecessary confusion.unnecessary confusion. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 107107
  • 108. Importance of Data DictionaryImportance of Data Dictionary  Data dictionary provides the definition ofData dictionary provides the definition of different data: In terms of their componentdifferent data: In terms of their component elements.elements.  For large systems, The data dictionary growsFor large systems, The data dictionary grows rapidly inrapidly in sizesize andand complexitycomplexity..  –– Typical projects can have thousands of dataTypical projects can have thousands of data dictionary entries.dictionary entries. –– It is extremely difficult to maintain such aIt is extremely difficult to maintain such a dictionary manually.dictionary manually. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 108108
  • 109.  CASECASE (Computer Aided Software Engineering)(Computer Aided Software Engineering) tools come handy:tools come handy: –– CASE tools capture the data items appearingCASE tools capture the data items appearing in a DFD automatically to generate the datain a DFD automatically to generate the data dictionarydictionary 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 109109
  • 110.  Composite data are defined in terms ofComposite data are defined in terms of primitive data items using following operators:primitive data items using following operators:  ++: denotes: denotes composition of data itemscomposition of data items,, e.g. – a+b represents data a and b.e.g. – a+b represents data a and b.  [,,,][,,,]: represents: represents selectionselection,,  –– i.e. any one of the data items listed inside thei.e. any one of the data items listed inside the square bracket can occur.square bracket can occur.  –– For example, [a,b] represents either a occursFor example, [a,b] represents either a occurs or b occurs.or b occurs. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 110110
  • 111.  ( )( ): contents inside the bracket represent: contents inside the bracket represent optional dataoptional data –– which may or may not appear.which may or may not appear. e.g. – a+(b) represents either a or a+b occurs.e.g. – a+(b) represents either a or a+b occurs.  {}{}: represents: represents iterative data definitioniterative data definition,, –– e.g. {name}5 represents five name data.e.g. {name}5 represents five name data. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 111111
  • 112.  {name}*{name}* representsrepresents –– zero or more instances of name data.zero or more instances of name data.  == representsrepresents equivalenceequivalence,, –– e.g. a=b+c means that a represents b and c.e.g. a=b+c means that a represents b and c.  * ** *: Anything appearing within * * is: Anything appearing within * * is considered asconsidered as commentcomment.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 112112
  • 113. Data Dictionary for RMS SoftwareData Dictionary for RMS Software numbers=valid-numbers=a+b+cnumbers=valid-numbers=a+b+c a:integer * input number *a:integer * input number * b:integer * input number *b:integer * input number * c:integer * input number *c:integer * input number * asq:integerasq:integer bsq:integerbsq:integer csq:integercsq:integer squared-sum: integersquared-sum: integer Result=[RMS,error]Result=[RMS,error] RMS: integerRMS: integer * root mean square value** root mean square value* error: stringerror: string * error message** error message* 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 113113
  • 114.  DuringDuring structured designstructured design,,  –– The DFD representation is transformed to aThe DFD representation is transformed to a structure chartstructure chart representation.representation.  ●● DFDs are very popular:DFDs are very popular:  –– Because it is a veryBecause it is a very simple techniquesimple technique.. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 114114
  • 115.  A DFD model:A DFD model: –– Difficult to implementDifficult to implement using a programmingusing a programming language:language:  Structure chart representation can be easilyStructure chart representation can be easily implemented using a programming language.implemented using a programming language. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 115115
  • 116. Trading-House AutomationTrading-House Automation System (TAS)System (TAS)  A large trading house wants us to develop aA large trading house wants us to develop a software:software:  –– ToTo automate book keeping activitiesautomate book keeping activities associated with its business.associated with its business.  It has manyIt has many regular customersregular customers:: –– WhoWho place ordersplace orders for various kinds offor various kinds of commodities.commodities. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 116116
  • 117.  The trading house maintainsThe trading house maintains names andnames and addressesaddresses of its regular customers.of its regular customers.  Each customer isEach customer is assigned a uniqueassigned a unique customer identificationcustomer identification number (CIN).number (CIN).  As per current practice when aAs per current practice when a customercustomer places orderplaces order::  –– The accounts department first checks theThe accounts department first checks the credit-worthinesscredit-worthiness of the customerof the customer 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 117117
  • 118.  The credit worthiness of a customer isThe credit worthiness of a customer is determined:determined:  –– ByBy analyzing the history of his paymentsanalyzing the history of his payments to the bills sent to him in the past.to the bills sent to him in the past.  If a customer is not credit-worthy:If a customer is not credit-worthy:  –– His ordersHis orders areare not processednot processed any furtherany further –– An appropriateAn appropriate order rejection messageorder rejection message isis generated for the customer.generated for the customer. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 118118
  • 119.  If a customer is credit-worthy:If a customer is credit-worthy:  –– Items he/she has ordered are checkedItems he/she has ordered are checked against the list of items the trading houseagainst the list of items the trading house deals with.deals with.  The items that theThe items that the trading house does nottrading house does not deal withdeal with:: –– AreAre not processednot processed any furtherany further –– AnAn appropriate messageappropriate message for the customer forfor the customer for these items is generated.these items is generated. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 119119
  • 120.  The items in a customer's order that theThe items in a customer's order that the trading house deals with:trading house deals with:  –– AreAre checked for availabilitychecked for availability in inventory.in inventory.  If the items are available in the inventory inIf the items are available in the inventory in desired quantities:desired quantities:  –– AA bill with the forwarding address of thebill with the forwarding address of the customer is printedcustomer is printed..  –– AA material issue slipmaterial issue slip is printed.is printed. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 120120
  • 121.  The customer can produce theThe customer can produce the material issuematerial issue slipslip at the storehouse:at the storehouse:  –– Take delivery of the items.Take delivery of the items.  –– Inventory data adjusted to reflect the sale toInventory data adjusted to reflect the sale to the customer.the customer. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 121121
  • 122.  If an ordered item is not available in theIf an ordered item is not available in the inventory in sufficient quantity:inventory in sufficient quantity:  –– To be able to fulfillTo be able to fulfill pending orderspending orders storestore details in a "details in a "pending-orderpending-order" file :" file :  out-of-stockout-of-stock items along with quantityitems along with quantity ordered. customer identification numberordered. customer identification number 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 122122
  • 123.  The purchase department: wouldThe purchase department: would periodicallyperiodically issue commands to generate indentsissue commands to generate indents..  When generate indents command is issued:When generate indents command is issued:  –– The system should examine theThe system should examine the "pendingorder“"pendingorder“ filefile –– Determine theDetermine the ordersorders that are pendingthat are pending –– Total quantityTotal quantity required for each of the items.required for each of the items. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 123123
  • 124.  TAS should find out theTAS should find out the addresses of theaddresses of the vendorsvendors who supply the required items:who supply the required items: –– ExamineExamine the file containingthe file containing vendorvendor detailsdetails (their address, items they supply etc.)(their address, items they supply etc.) –– Print out indentsPrint out indents to those vendorsto those vendors 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 124124
  • 125.  TAS should also answersTAS should also answers managerial queriesmanagerial queries::  –– Statistics of different items soldStatistics of different items sold over anyover any given period of timegiven period of time  –– CorrespondingCorresponding quantity sold and the pricequantity sold and the price realized.realized. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 125125
  • 126. Context Diagram for TASContext Diagram for TAS 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 126126
  • 127. Level 1 DFD for TASLevel 1 DFD for TAS 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 127127
  • 128. Data Dictionary for TASData Dictionary for TAS  response: [bill + material-issue-slip, reject-response: [bill + material-issue-slip, reject- message]message]  query: period /* query from manager regardingquery: period /* query from manager regarding sales statistics*/sales statistics*/  period: [date+date,month,year,day]period: [date+date,month,year,day]  date: year + month + daydate: year + month + day  year: integeryear: integer  month: integermonth: integer  day: integerday: integer 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 128128
  • 129.  order: customer-id + {items + quantity}*order: customer-id + {items + quantity}*  accepted-order: order /* ordered itemsaccepted-order: order /* ordered items available in inventory */available in inventory */  reject-message: order + message /* rejectionreject-message: order + message /* rejection message */message */  pending-orders: customer-id +pending-orders: customer-id + {items+quantity}*{items+quantity}*  customer-address:customer-address: name+house#+street#+city+pinname+house#+street#+city+pin 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 129129
  • 130.  item-name: stringitem-name: string  house#: stringhouse#: string  street#: stringstreet#: string  city: stringcity: string  pin: integerpin: integer  customer-id: integercustomer-id: integer  bill: {item + quantity + price}* + total-amount +bill: {item + quantity + price}* + total-amount + customer-addresscustomer-address  material-issue-slip: message + item + quantity + customer-material-issue-slip: message + item + quantity + customer- addressaddress  message: stringmessage: string  statistics: {item + quantity + price }*statistics: {item + quantity + price }*  sales-statistics: {statistics}*sales-statistics: {statistics}*  quantity: integerquantity: integer 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 130130
  • 131.  Guidelines For Constructing DFDsGuidelines For Constructing DFDs  Context diagramContext diagram should representshould represent the system as athe system as a single bubblesingle bubble::  –– Many beginners commit the mistake ofMany beginners commit the mistake of drawing more than one bubble in the contextdrawing more than one bubble in the context diagram.diagram. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 131131
  • 132.  AllAll external entitiesexternal entities should be represented inshould be represented in thethe context diagramcontext diagram::  –– External entities should not appear at anyExternal entities should not appear at any other level of DFD.other level of DFD.  Only 3 to 7 bubbles per diagram should beOnly 3 to 7 bubbles per diagram should be allowed: Each bubble should be decomposed toallowed: Each bubble should be decomposed to between 3 and 7 bubbles.between 3 and 7 bubbles. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 132132
  • 133.  A common mistake committed by manyA common mistake committed by many beginners:beginners:  –– Attempting to represent controlAttempting to represent control information in a DFD.information in a DFD.  –– e.g. trying to represent thee.g. trying to represent the orderorder in whichin which different functions are executed.different functions are executed. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 133133
  • 134.  A DFDA DFD does notdoes not representrepresent controlcontrol information:information:  –– The conditions under which differentThe conditions under which different functions are invoked are not represented.functions are invoked are not represented.  –– For example, a function might invoke oneFor example, a function might invoke one function or another depending on somefunction or another depending on some condition.condition.  –– Many beginners try to represent this aspectMany beginners try to represent this aspect by drawing an arrow between theby drawing an arrow between the corresponding bubbles.corresponding bubbles. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 134134
  • 135. Shortcomings of the DFD ModelShortcomings of the DFD Model DFD models suffer from several shortcomings:DFD models suffer from several shortcomings: ●● DFDs leave ample scope to beDFDs leave ample scope to be impreciseimprecise.. –– In a DFD model, we infer about the functionIn a DFD model, we infer about the function performed by a bubble from its label.performed by a bubble from its label. –– A label may not capture all the functionalityA label may not capture all the functionality of a bubbleof a bubble 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 135135
  • 136. For example, a bubble named find-bookpositionFor example, a bubble named find-bookposition has only intuitive meaning:has only intuitive meaning: –– Does not specify several things:Does not specify several things: ●● What happens when someWhat happens when some input informationinput information is missing or is incorrectis missing or is incorrect.. ●● Does not convey anything regardingDoes not convey anything regarding whatwhat happens when book is not foundhappens when book is not found ●● or what happens if there are books by differentor what happens if there are books by different authors with the same book title.authors with the same book title. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 136136
  • 137. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 137137
  • 138. A DFD does notA DFD does not specifyspecify synchronizationsynchronization aspectsaspects:: –– For instance, the DFD in TAS example doesFor instance, the DFD in TAS example does not specify:not specify: ●● WhetherWhether process-order may wait until theprocess-order may wait until the accept-order produces dataaccept-order produces data ●● WhetherWhether accept-order and handle-orderaccept-order and handle-order may proceed simultaneouslymay proceed simultaneously with somewith some buffering mechanism between thembuffering mechanism between them 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 138138
  • 139. The way decomposition is carried out to arrive atThe way decomposition is carried out to arrive at the successive levels of a DFD isthe successive levels of a DFD is subjectivesubjective.. ●● The ultimate level to which decomposition isThe ultimate level to which decomposition is carried out is subjective:carried out is subjective: –– Depends on theDepends on the choice and judgement of thechoice and judgement of the analyst.analyst. ●● Even for theEven for the same problem,same problem, –– Several alternative DFD representationsSeveral alternative DFD representations areare possible:possible: –– Many times it is not possible to say whichMany times it is not possible to say which DFD representation is superior or preferable.DFD representation is superior or preferable. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 139139
  • 140. DFD technique does not provide:DFD technique does not provide: –– Any clear guidance as to how exactly oneAny clear guidance as to how exactly one should goshould go about decomposingabout decomposing a function:a function: –– One has to useOne has to use subjective judgementsubjective judgement to carryto carry out decomposition.out decomposition. ●● Structured analysis techniques do not specifyStructured analysis techniques do not specify when to stop a decomposition processwhen to stop a decomposition process:: –– To what length decomposition needs to beTo what length decomposition needs to be carried out.carried out. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 140140
  • 141. Structured DesignStructured Design  Aim is to transform the result ofAim is to transform the result of structuredstructured analysisanalysis ( i.e. DFD )into( i.e. DFD )into structured chart.structured chart.  A structured chart represents the softwareA structured chart represents the software architecture, i.e. the various modules makingarchitecture, i.e. the various modules making up the system, the module dependency and theup the system, the module dependency and the parameters that are passed among the differentparameters that are passed among the different modulesmodules 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 141141
  • 142. The building blocks of structured chart:The building blocks of structured chart: 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 142142
  • 143.  One and onlyOne and only one moduleone module at the topat the top • At mostAt most one control relationshipone control relationship between any twobetween any two modules. (modules arranged in Layers / levels)modules. (modules arranged in Layers / levels)  The principle ofThe principle of abstractionabstraction doses not allowdoses not allow the lower level modules to be aware of thethe lower level modules to be aware of the existence of the higher level modulesexistence of the higher level modules 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 143143
  • 144. Transformation of a DFD into aTransformation of a DFD into a Structured Chart:Structured Chart: 1)1) Transform AnalysisTransform Analysis 2)2) Transaction AnalysisTransaction Analysis  Start with 1 Level DFD and then proceed toStart with 1 Level DFD and then proceed to lower level DFDslower level DFDs  At each level of transformation, determineAt each level of transformation, determine whether it iswhether it is transformtransform oror transactiontransaction analysis applicable??analysis applicable?? 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 144144
  • 145. Transform AnalysisTransform Analysis  If all dataIf all data inputinput to the diagram areto the diagram are processedprocessed in a similar waysin a similar ways (i.e. if all input data are(i.e. if all input data are incident on the same bubble in the DFD), thenincident on the same bubble in the DFD), then transform analysis is applicable.transform analysis is applicable.  It is applicable toIt is applicable to very small problemsvery small problems or ator at the lower level DFD.the lower level DFD. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 145145
  • 146. Transaction AnalysisTransaction Analysis  Each different way in which data is processedEach different way in which data is processed corresponds to a separate transaction.corresponds to a separate transaction.  Each transaction corresponds to aEach transaction corresponds to a functionality.functionality.  Useful for transaction processing systemUseful for transaction processing system  For each transaction, we trace the input data toFor each transaction, we trace the input data to the output data.the output data. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 146146
  • 147.  The transaction is identified by studying theThe transaction is identified by studying the discrete event types that drive the systemdiscrete event types that drive the system  The threeThe three transaction typestransaction types here are:here are: CheckCheck Availability (an enquiry), Reserve TicketAvailability (an enquiry), Reserve Ticket (booking) and Cancel Ticket (cancellation)(booking) and Cancel Ticket (cancellation).. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 147147
  • 148. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 148148
  • 149. Transform AnalysisTransform Analysis  Transform analysis is strategy of convertingTransform analysis is strategy of converting each piece of DFD (may be from level 2 oreach piece of DFD (may be from level 2 or level 3, etc.) for all the identified transactionlevel 3, etc.) for all the identified transaction centers.centers.  In case, the given system has only oneIn case, the given system has only one transaction (like a payroll system), then we cantransaction (like a payroll system), then we can start transformation from level 1 DFD itself.start transformation from level 1 DFD itself. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 149149
  • 150.  Transform analysis is composed of theTransform analysis is composed of the following five steps:following five steps: 1.1. Draw a DFD of a transaction type (usually doneDraw a DFD of a transaction type (usually done during analysis phase)during analysis phase) 2.2. Find theFind the central functionscentral functions of the DFDof the DFD 3.3. Convert the DFD into a first-cut structure chartConvert the DFD into a first-cut structure chart 4.4. Refine the structure chartRefine the structure chart 5.5. Verify that the final structure chart meets theVerify that the final structure chart meets the requirements of the original DFDrequirements of the original DFD 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 150150
  • 151. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 151151
  • 152. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 152152
  • 153. Partitioning DFDPartitioning DFD  Transformation-Centered Application:Transformation-Centered Application:  Data flow in a sequence, i.e. in a straight lineData flow in a sequence, i.e. in a straight line manner.manner.  Focus is on file handling and manipulation of data.Focus is on file handling and manipulation of data.  Example: Sequential processing of a purchaseExample: Sequential processing of a purchase orderorder 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 153153
  • 154. Transformation Analysis…Transformation Analysis… 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 154154
  • 155. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 155155
  • 156. Transaction Analysis…Transaction Analysis… 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 156156
  • 157. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 157157
  • 158. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 158158
  • 159. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 159159
  • 160. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 160160
  • 161. 01/25/1901/25/19 MODULE-V SOFTWARE DESIGNMODULE-V SOFTWARE DESIGN 161161