copy of software design

82

Upload: jincy-jacob

Post on 10-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 1/82

Page 2: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 2/82

Definition of Software design:

Process of :

- Defining architecture of the system

- components used in the design

- Interfaces to be established

- incorporate the salient features of the

system.It’s a process of producing model of the system

It’s a phase in software engineering life cycleprocess.

Its platform independent or platform dependentdesign

Page 3: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 3/82

Design Types:Structural Design model: Represent architecture as

an organized collection of program components.Static components needs to be developed so thatit can be developed as independent unit.

Framework design model: Helps to increase thelevel of design abstraction. It identifies repeatable

architecture design or framework or patterns thatare encountered in similar type of applications.Dynamic design model: It address behavior aspects

of program architecture configuring the systemand respond to external events.

Process design model: Deals with the technicalaspects that the system must accommodate.Functional design model: Represents functional

hierarchy of a system.

Page 4: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 4/82

Design Process

System design process involves decidingwhich system capabilities are to beimplemented in software and which inhardware. .

 The process of converting a systemspecification in to an executable system iscalled software design.

Designers do not arrive at a finished design

immediately but develop the design iterativelythrough a number of different versions.

Page 5: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 5/82

Levels of design process:Design process has two levels.System design or Top-level designDetailed design or Logic design

System design

makes use of modules needed for the

system, specifications of the modules andmodule interconnections are decided.

Detailed design concentrates on:

the internal design of the modules,

processing logic and data structures.Detailed design may be function-oriented or

object-oriented.

Page 6: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 6/82

Design process activities

Architectural designAbstract specification

Interface design

Component design

Data structure design

Algorithm design

Page 7: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 7/82

Architectural design The design process for identifying the sub-

systems making up a system and the framework for sub-system control and communication is

architectural design.

 The output of this design process is a descriptionof the software architecture.

An early stage of the system design process.

Represents the link between design andrequirements engineering process

Page 8: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 8/82

Software architecture document serves as design plan. It actsas a starting point for design. It hides details and allowsdesigners to focus on key system abstractions.

System architecture affects performance, robustness,maintainability etc

Architectural design is a creative process involving decisionslike :

What architectural style - repository or layered etc

What control strategy - centralised or event drivenHow to document architectural designHow to evaluateWhether system is distributed across processors etc

3 activities common to architectural design process areSystem structuring

Control modellingModular decomposition

Page 9: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 9/82

Data comms.system

Transponder

system

Radar

system

Aircraft

comms.

Telephone

system

Flight plandatabase

Backupposition

processor

Positionprocessor

Comms.processor

Backup comms.processor

Aircraftsimulationsystem

Weather mapsystem

Accountingsystem

Controllerinfo. system

Controllerconsoles

Activity loggingsystem

©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 31. Slide ##

ATC systemarchitecture

Page 10: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 10/82

System structuring:

First activity in architectural design

Concerned with decomposing the system intointeracting sub-systems.

 The architectural design is normally expressed as ablock diagram presenting an overview of the systemstructure.

More specific models showing how sub-systems sharedata, are distributed and interface with eachother may also be developed.

Following models are used for structuring the system:

Repository model

Client-server model

Layered model

Page 11: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 11/82

Architectural models

Static structural model shows the major systemcomponents.

Dynamic process model shows the processstructure

Interface model shows sub-system interfaces and

services offered by each sub-system .Ex: Layered model

Relationships model shows sub-systemrelationships.

Ex: Data flow modelDistribution model that shows how sub-systems are

distributed across computers.

Ex: Client server architectural models

Page 12: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 12/82

Control modeling:A general model of controlling between subsystems is

established.Since structural models do not constitute control information,

control models should do this Two types of control models:

Centralized control modelEvent driven control model

Modular decompositionAnother structural level where sub-systems are decomposed

into modules. Two modular decomposition modelsObject oriented decompositionFunction oriented decomposition

An object model where the system is decomposed intointeracting object;A pipeline or data-flow model where the system is

decomposed into functional modules

Page 13: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 13/82

Abstract specification:

Each sub system must provide abstractspecification consisting of:

-services to be offered-constraints under which it must operate.

Page 14: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 14/82

Interface design

Subsystems must interface with other subsystems.Interface specification is very important

It is a codification part that interface the othersubsystems

Interface design focuses on 3 important areas:

- Design of interfaces between software modules

- Design of interfaces between the subsystems

- Design of interface between system and externalfactors.

Page 15: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 15/82

Component design:

Every system requires many components.

Components may be re usable. With littlemodifications, re-usable components may bedesigned to suit system.

For each component design, specificationsare very important.

Page 16: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 16/82

Data structure design:

Logical representation of data objects identifiedhelps in data structure design

It translates data objects defined in analysismodel into data structures that reside within the

software.Choice of data structure depends on data

attributes, relationship between these dataobjects their use within the program.

Data structures used in the system depends onthe type of system.

Specification of data structure is essential todraw architectural design.

Page 17: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 17/82

Algorithm design:

 They are set of statements in step wisemanner to explain the working of the system.

It gives skeletal framework of the problemand solution.

Page 18: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 18/82

Repository modelIt is a model in architectural design to structure

the system.

Sub systems must communicate to exchangeinformation. This can be possible in 2 ways:

1. Shared data is held in central database thatcan be accessed by all sub systems. A system

model based on a shared database is sometimescalled a repository model.

2. Each subsystem maintains its own database.Data is interchanged with other subsystems bypassing messages to them.

 This model suits to applications where data isgenerated by one sub system and used byanother.

Page 19: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 19/82

Designtranslator Project repository

Design editorDesign

analyser

Codegenerator

Reportgenerator

Programeditor

Page 20: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 20/82

Advantages

Efficient way to share large amounts of data.

Subsystems that produce data need not be concerned with how data isused by other sub systems

Activities such as backup, security, access control and recovery arecentralized so that sub systems can concentrate on their principlefunctionality rather than be concerned with these issues.

Its easy to integrate new tools given that they are compatible with theagreed data model.

Disadvantages:

Subsystems must agree on repository model where performance maybe compromised

Some times may be difficult to integrate new sub-systems if theirdata models do not fit agreed schema

Different subsystems may have different requirements for security,recovery etc and repository model forces for same policy in all subsystems.

Although it is possible to distribute the logically centralized repositorythere may be problems with data redundancy and inconsistency

Page 21: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 21/82

Client server model:In this model system is organized as set of services

and associated servers and clients that access anduse services.

Major components of the model:

- Set of servers that offer services to othersubsystems.

Examples of servers are print servers, fileservers etc - Set of clients that call on the servicesoffered by servers. These are consideredsubsystems.

- Network that allows clients to access theseservices. Necessary if client and server are indistributed systems

Architecture of a firm and picture library

Page 22: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 22/82

Internet

Client 1 Client 2 Client 3 Client 4

CatalogueServerLibrary

Catalogue

WebServer

Film andPhoto info

PictureServer

Digitizedphotograph

s

VideoServer

Film clipfiles

Architecture of a firm and picture librarysystem

Page 23: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 23/82

Advantages: This model is in distributed architecture, networked

systems with distributed processors.

It is easy to add a new server and integrate it with restof the system

Existing servers can be upgraded without affectingother components of the system.

Disadvantages:

Every server must take responsibility of datamanagement activities like back-up, recovery etc.

Integration of new server may require changes inexisting clients and servers to gain full benefits of newserver.

Lack of shared model

Page 24: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 24/82

Layered model Or Abstract machine model:

Organizes system into layers, each layerprovide set of services.

Operating system layer

Configuration management system layer

Object management system layer

Database system layer

Page 25: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 25/82

Configuration management system managesversions of objects and provides generalconfiguration management facilities.

It uses an object management system thatprovides information storage andmanagement services for configuration items

or objects. This is built on top of data base system to

provide basic data storage and services suchas transaction management, roll back etc

Data base management uses operatingsystem facilities in its implementation.

Page 26: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 26/82

 The layered approach supports the incrementaldevelopment of the system

As a layer is developed, some of the services providedby that layer may be available to users.

A layer can be replaced by another equivalent layer if interface is unchanged

If interface is changed , adjacent layers may getaffected.

Disadvantage :

Structuring system in this way is difficult.

Services required by a user of bottom level maytherefore have to punch through adjacent layers to get

access to services that are provided several levelsbeneath

Performance can be problem if there are many layersbefore it is processed.

 

Page 27: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 27/82

Control models:

Control models are concerned with controlflow between subsystems.

2 generic control styles :

Centralized controlEvent based control

Page 28: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 28/82

Centralized control:

One sub system is designated as systemcontroller and has responsibility formanaging the execution of other sub system.

It may also devolve control to anothersubsystem but will expect to have this control

responsibility returned to it2 types:

Call return model

Manager model

Page 29: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 29/82

Call return model:

Familiar top down subroutine model

Applicable to sequential systems.

Control starts at top of the subroutine and through subroutinecalls passes to lower levels in the tree.

Strength: Is relatively simple to analyse control flows

Weakness: To handle exceptions to normal operations

Page 30: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 30/82

Routine 3

Main program

Routine 1 Routine 2

Routine 3.2Routine 3.1Routine 1.2Routine 1.1

Page 31: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 31/82

Manager model:

Appropriate for concurrent systems

One system component is designed as asystem manager that manages the starting,stopping and coordination of other systemprocesses.

Subsystems can be executed parellelly

Page 32: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 32/82

Systemcontroller

System 1

System 2

System 3

System 4

Page 33: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 33/82

Event driven Models:

Apt for modeling systems which are driven byexternal events.

 Two types:

Broad cast modelInterrupt driven model

Page 34: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 34/82

Broad cast model:Appropriate for integrating sub systems distributed

across different computers on the network.

 The occurrence of event is broad casted to allsubsystems

Subsystem which can handle that event responds toit.

Broad casting to all subsystem is an overhead.Message handler maintains a register of subsystems

and events of their interest.

It detects the event, confirms with the event register

and transfers the event to those subsystems that haveregistered an interest in the event.

Broad cast control model:

Page 35: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 35/82

Subsystem

1

Subsystem2

Subsystem3

Subsystem4

Event and message handler

Broad cast control model:

Page 36: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 36/82

Advantages:

1.New subsystems can be easily added to

handle particular class of events2.Any sub system can activate any other sub

system without knowing its name andlocation.

Disadvantages:

1.Different subsystems may register their

interest for the same event, causing conflict2.Difficult to determine when the result of the

event will be available.

Page 37: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 37/82

Interrupt driven model:Exclusively used in real time systems with

stringent timing requirement.

Real time systems are provided with interrupt –driven control

In this model:

Events are linked to Interrupts

Each interrupt is associated with memory locationwhere handler’s address is stored.

The table containing the addresses of Interrupthandler’s is called Interrupt vector table.

At occurrence of an interrupt, the control is

transferred to its handler.Now handler takes control of the process.

I t t

Page 38: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 38/82

Handler 1

Handler 2

Handler 3

Process 1

Process 3

Process 2

Interruptvector

Interrupts

Page 39: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 39/82

Advantages:

It responds very fast to the events to be

implemented

Disadvantages:

It involves complex programming andvalidation to generate same interrupt timingduring testing

Number of interrupts to be handled is limited

by hardware.

Page 40: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 40/82

Modular decomposition:

Decomposition of subsystems into moduleshappens.

Decomposition based on 2 models:

- Function oriented

- Object oriented

Page 41: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 41/82

Object oriented model:

System is decomposed into a set of  looselycoupled, communicating objects with welldeined interfaces.

 This decomposition deals with object classes

their attributes and operations.

Objects are created from these classes.

Objects call on services offered by other

objects. To coordinate the object operation, this

control model is used.

Object model of an invoice processing

Page 42: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 42/82

CustomerCustomer#

NameAddress

Credit period

ReceiptInvoice#

DateAmount

Custmer#

Payment

Invoice#DateAmount

Customer#

IInvoiceInvoice#

DateAmount

Customer

Issue()Send

remainder()Acceptpayment(

)

Object model of an invoice processingsystem:

Page 43: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 43/82

Advantages:

 The implementation of objects can be modified withoutaffecting other objects because objects are loosely coupled.

It makes the system structure easily understandable

Object oriented programming facilitates implementation of objects in parallel.

Objects can be reused

Disadvantages:

 The objects must explicitly refer names and interface of other objects offering the services.

Complex activities are difficult to represent as object

If an interface change, the effect of that change on all usersof the changed object must be evaluated.

Page 44: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 44/82

Function oriented pipelining:

 This model shows how inputs are processed byfunctional transformation and how outputs areproduced.

Each processing step is a functionaltransformation

 These transformations may executesequentially or in parallel.

Pipeline model of an invoice processing

Page 45: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 45/82

Readissued

invoices

Identifypayment

s

Issue

receipts

Findpayment

s due

Issuepaymentremaind

er

Invoices Payments

Remainders

Receipts

Pipeline model of an invoice processingsystem:

Page 46: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 46/82

Advantages of function oriented pipelining:

Reuse of transformations is possible

New transformations are easy to addIt is simple to implement and transformations

may execute sequentially or in parallel

It is easy to understand the system in terms of 

input and output processing

Disadvantages:

It requires a common format for data transfer

that can be recognized by all transformationsInteractive systems are difficult to write using

data flow model because of the need for astream of data to be processed

Page 47: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 47/82

Domain specific

architecturesSome architectural models are specific to

particular application domain, called Domainspecific architecture.

2 types of domain specific architecturalmodels are:

- Generic models- Reference models

 

Page 48: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 48/82

Generic model:

Used to represent real time systems.Generic models are reused in design

Best example for generic architecture modelis compiler.

a a ow mo e oil

Page 49: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 49/82

Symbol table

Syntax tree

Lexicalanalyser

Codegeneration

Semanticanalyser

Syntaxanalyser

compiler

Page 50: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 50/82

1. A lexical analyzer which takes input languagetokens and converts them to some internal form

2. A symbol table holds information about the names

of classes, objects, variables etc used3. A syntax analyzer checks the syntax of language

being translated and syntax tree is built

4. Syntax tree is an internal structure representing the

program being compiled5. A semantic analyzer, uses info from the syntax tree

and the symbol table to check the semanticcorrectness of the input language text

6. Code generator generates abstract machine code

Page 51: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 51/82

Reference Architecture:

Describes layered systems They are abstract presentation of system

domain

 They incorporate all features that include in

system being developedExample is OSI model

It’s a layered model

Each layer provides specific service

If needed any layer can be reimplementedwith out affecting other layers.

Page 52: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 52/82

Application

Presentation

Session

 Transport

Network

Datalink

Physical

Page 53: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 53/82

OSI MODEL:It is a way of sub-dividing a communications system into

smaller parts called layers. A layer is a collection of 

conceptually similar functions that provide services to thelayer above it and receives services from the layer belowit.

 Physical Layer: defines the electrical and physicalspecifications for devices. It defines the relationshipbetween a device and a transmission medium, such as acopper or optical cable.

Establishment and termination of a connection to acommunications medium

Data Link Layer provides the functional and proceduralmeans to transfer data between network entities and todetect and possibly correct errors that may occur in the

Physical Layer The Network Layer provides the functional and proceduralmeans of transferring variable length data sequences froma source to a destination via one or more networks, whilemaintaining the quality of service requested by the Transport Layer

Page 54: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 54/82

 The Transport Layer provides transfer of databetween end users, providing reliable datatransfer services to the upper layers

 The Session Layer controls the connectionsbetween computers. It establishes, manages andterminates the connections between the localand remote application.

 The Presentation Layer establishes contextbetween Application Layer entities, in which thehigher-layer entities may use different syntaxand semantics if the presentation serviceprovides a mapping between them.

 The Application Layer is the OSI layer closest tothe end user, which means that both the OSIapplication layer and the user interact directlywith the software application.

Design quality

Page 55: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 55/82

Design qualityDesign quality is an elusive concept.A good design may be a design that allows efficient code to be producedA 'good' design may have characteristics like:

- Capturing all the functionalities of the system correctly- Easily understandable- Efficient- Easily amenable to change

Adaptability, robustness, clarity, compactness , flexibility etcUnderstandability is major factor because it influences maintainability.However, goodness of design involves many factors, which depend on

particular application. A design solution which is good for one applicationmay not be good for another application

Ex: For embedded applications, comprehensibility takes back seat .sinceit must be implemented in a limited size of memory. So to achievecompactness, comprehensibility is sacrificed.

Quality characteristics are equally applicable to function-oriented andobject-oriented designs

Page 56: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 56/82

Cohesion

Cohesion is measure of relative functional strength of elements of a module

Cohesion implies that a component or classencapsulates only attributes and operations that are

closely related to one another .Modules with good cohesion require less coupling

Strong cohesion is desirable

A cohesive module performs a single task within asoftware procedure with little interaction withprocedures that are performed in other parts of aprogram.

Page 57: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 57/82

Various types in cohesion:

Coincidental cohesionLogical cohesion

Communication cohesion

Sequential cohesion

Functional cohesion

Procedural cohesion

Page 58: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 58/82

Coincidental cohesion

 This cohesion occurs when parts of a moduleare grouped arbitrarily (randomly)

Only relationship between parts is that they

have been grouped together.Ex: Utility class consisting of utility functions

like cleaning disk, antivirus, copying fromexternal disk etc.

Page 59: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 59/82

Logical cohesion

 This cohesion occurs when parts of moduleare grouped because they are categorizedlogically to do same thing even if they are

different by nature.Ex: Grouping all mouse and keyboard input

handling routines

Page 60: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 60/82

Communicational Cohesion:

 This cohesion occurs when parts of module aregrouped because they operate on same data.

Module1

Module2

Module3

Module4

Data Set

Output

Page 61: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 61/82

Page 62: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 62/82

Functional Cohesion:

 This level of cohesion occurs when a moduleperforms one and only one computation andthen returns a result.

Specific functional module.

Page 63: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 63/82

Procedural cohesion:

Modules perform a series of steps

Components or operations are grouped in amanner that allows one to be invokedimmediately after the preceding one wasinvoked, even when there is no data passedbetween them.

 That is, elements in the module must take upsingle control sequence and must be executedin a specified order.

Page 64: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 64/82

Page 65: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 65/82

Content coupling: This coupling occurs when one component modifiies data that isinternal to another component.

Violates information hiding – a basic design concept.

Module 1 Module 2

Page 66: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 66/82

Common coupling:

 This coupling occurs when a number of componentsall make use of global variable.

Although this is sometimes necessary, commoncoupling can lead to uncontrolled error propagationand unforeseen side effects when changes are made.

Module 1 Module 2

Data

sharing

Page 67: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 67/82

Control coupling:

 This coupling occurs when one module controls thelogic flow of another module.Passing Yes or No flag from one module to anotherModule A sends control flag to Module B.Depending on the type of flag the sequence of 

processing in module B is controlled

Module 1 Module 2

Page 68: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 68/82

Stamp coupling:

 This coupling occurs when Class B is declared asa type for an argument of an operation of ClassA, Because Class B is now a part of thedefinition of Class A, modifying the system

becomes more complex

Module 1 Module 2

Data

Page 69: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 69/82

Data coupling:

 This coupling occurs when operations passlong strings of data arguments

Since communication between classes growsand complexity increases

 Testing and maintenance are more difficult.

Module 1 Module 2

Page 70: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 70/82

External coupling: This coupling occurs when one component communicates and

collaborates with infrastructure components (eg., Operating systemfunctions) . Modules share external data format. Mostly used incommunication protocols and device interfaces. Ex: CAN(Controlled Area Network) protocol used in Automotiveapplications

Although this type of coupling is necessary, it should be limited to asmall number of components or classes within the system.

Module A

Protocol DeviceInterface

D i P i i l

Page 71: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 71/82

 Design PrinciplesDesign principles enable software designers to come up

with a good design to the systemProblem partitioning

Abstraction

Modularity

Problem Partitioning:

Dividing complex problems into small sub programs.

Each sub program can be handled independently.

 Then integrate to form whole executable program.

It’s a method of DIVIDE AND CONQUER

Page 72: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 72/82

Abstraction:Method of describing the program functionality

Levels of Abstraction:

Data abstraction:Collection of data describing the data object

Ex: Door – Type of door, door weight etc

Procedural abstraction: Reflects functionalabstraction.

Sequence of instructions that has specificfunctionality

Ex: Open door.:

Control Abstraction: States desired state with outspecifying exact control mechanism.

Ex: Applying the break

Modularit

Page 73: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 73/82

Modularity: Module contains :

Set of instructions,Some processing logicSome Data structures

Module can be compiled and stored in library andincluded in program.

Modularity is Logical partitioning of software design

Modularity does imply interface overheads related toinfo exchangeModularity has 5 important critiria.

Modular decompositionModular composability

Modular understandabilityModular continuityModular Protection

Modular Decomposition:

Page 74: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 74/82

Modular Decomposition:

Systematic method of decomposing a problem intosub problems, to reduce complexity of overallproblems

 Modular composability:It’s a method that enables the existing design

components to be assembled into a new system

 Modular understandability:

Making a module understand as a single unit withoutreferring to other modules.

Modular continuity:

Any small change in the system requirements ,changes individual modules, but try to make the

impact less Modular Protection:

Any problem in the module and its effects areconstrained within the module, so that impact of thaterror will be minimum.

Design Notation:

Page 75: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 75/82

Design Notation:Design notation along with structural programming

concepts help designer to represent Procedural detailsStructured Programming is Procedural design

technique.Some constructs are

Sequential ConstructConditional constructRepetitive construct

 The notations are :Graphical Notation

Flow chartsBox diagrams

 Tabular Design NotationDecision table

State diagramsPDL

Flow charts: Popular way of representing

Page 76: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 76/82

Flow charts: Popular way of representingprogramming logic.

Sequence

Conditional

Repetition

Box diagrams:

Page 77: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 77/82

F T

Else

 ThenPartpart

cLoop

Loop

 condition

Sequential box notation

Conditional box notation Looping box notation

Tabular design notation:

Page 78: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 78/82

 Tabular design notation:

Decision tables:

It translates actions and conditions intotabular form. It is divided into action stub and

condition stub

Page 79: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 79/82

A state machine is a different way of thinkingabout computation

A state machine has some number of states,

and transitions between those states Transitions occur because of inputs

A “pure” state machine only knows whichstate it is in—it has no other memory orknowledge

State machine model

Page 80: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 80/82

Page 81: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 81/82

PDL:Programming design language

Also called psuedocode

It uses vocabulary of English and overall syntaxof structured programming language

It’s a generic referencePDL may look like programming language.

PDL cannot be compiled

PDL uses English words embedded directlywithin statements

While using PDL no need to worry about syntax

Design Strategies:

Page 82: Copy of software design

8/8/2019 Copy of software design

http://slidepdf.com/reader/full/copy-of-software-design 82/82

Design Strategies:

Functional DesignObject oriented design