design notations - david r. cheriton school of computer …gweddell/cs446/designnotatio… ·  ·...

25
CS646: Software Design and Architectures Design notations Dynamic Data flow diagrams (DFDs). State transition diagrams (STDs). Statecharts. Structure diagrams. Static Entity Relationship Diagrams (ERDs). Class diagrams. Structure charts. Object diagrams.

Upload: truongxuyen

Post on 07-Apr-2018

220 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Design notations

DynamicData flow diagrams (DFDs).State transition diagrams (STDs).Statecharts.Structure diagrams.

StaticEntity Relationship Diagrams (ERDs).Class diagrams.Structure charts.Object diagrams.

Page 2: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Data Flow Diagrams (DFDs)

A notation developed in conjunction with structured systems analysis/structured design (SSA/SD).

Used primarily for pipe-and-filter styles of architecture.

Graph–based diagrammatic notation.

There are extensions for real-time systems that distinguish control flow from data flow.

Page 3: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

DFDs: Diagrammatic elements

A producer or consumer of information that resides outside the bounds of the system to be modeled.

externalentity

A transformation of information (a function) that resides within the bounds of the system to be modeled.

process

A data object; the arrowhead indicates the direction of data flow.data

object

A repository of data that is to be stored for use by one or more processes; may be as simple as a buffer or queue or as sophisticated as a relational database.

data store

Page 4: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Level 0 for SafeHome

SafeHomesoftware

controlpanel

sensors telephoneline

alarm

control paneldisplayuser commands

and data

sensorstatus

displayinformation

alarmtype

telephonenumber tones

Page 5: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g. (cont’): Level 1 (SafeHome software)

user commandsand data

controlpanel

sensors

telephoneline

alarm

control paneldisplay

displayinformation

configuresystem

interactwith user

processpassword

activate/deactivate

system

displaymessages and

status

monitorsensors

configuration information

password

configurerequuest

startstop

configurationdata

a/d msg.

valid id msg.

configurationdata

configurationdata

sensorinformation alarm type

telephonenumber tones

sensor status

Page 6: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g. (cont’): Level 2 (monitor sensors)

sensors

telephoneline

alarm

formatfor

display

generatealarmsignal

assessagainstsetup

readsensors

configuration information

configurationdata

sensor id,type

alarm type

telephonenumber tones

sensor status

dialphone

sensorinformation

telephonenumber

alarmdata

sensor id,sype,

location

Page 7: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

State Transition Diagrams (STDs)

Used for capturing state transition behavior in cases where there is an intuitive finite collections of states.

Derives from the notion of a finite state automaton.

Graph–based diagrammatic notation.Labeled nodes correspond to states.Arcs correspond to transitions.Arcs are labeled with events and actions (actions can cause further

events to occur).

E.g.: a telephone call!

Describes a single underlying process.

Page 8: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Aircraft landing behavior (from text)

in flight

stacked

landing approach

on runway

on ground

ABORT LANDINGclimb to

set height

STACKjoin at setheight CLEARED TO LAND

select path;adjust flaps;lower undercarriage TAKE OFF

lift undercarriage;select course;climb to set height

TOUCH DOWNreverse engine thrust;

brake

PARKtaxi to stand

CLEARED TO LANDselect path;

adjust flaps;lower undercarriage

CLEARED FOR TAKEOFFposition on runway;open throttles

ABORT TAKEOFFclose throttle;

brake;turn off runway

Page 9: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Statecharts

Developed by David Harel.

A generalization of STDs: States can have zero, one, two or more STDs contained within.

Related to Petri nets.

Higraph–based diagrammatic notation.Labeled nodes correspond to states.Arcs correspond to transitions.Arcs are labeled with events and actions (actions can cause further

events to occur).

Describes one or more underlying processes.

Page 10: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Teletext television set (from text)

standby

display

(any button press)

‘standby’

Page 11: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g. (cont’d): Teletext television set

picture

text

mixed

‘mixed’

‘text’ ‘text’

‘picture’

‘picture’

standby(any button press)

‘standby’display

Page 12: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g. (cont’d): Teletext television set

standby

display

(any button press)

‘standby’

off ‘power on’

‘power off’

powered

Page 13: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Aircraft landing behavior (from text)

landing approach

cruising

stacked

taxing

parked

touch down

takeoff

in flight

on ground

Page 14: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Describing more than one process

D

E H

G

F

A

b(P)

B C

ba

a

Page 15: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Structure Diagrams

Used in Jackson Structured Programming.

Used to describe several kinds of things.Ordered hierarchical structure.Sequential processing.

Based on the idea of regular languages.Sequencing.Selection.Iteration.

Page 16: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Ordered hierarchical structure

file of text

line

word

file body end of file

words end of line

seq. of characters delimiter

character punctuationmarks

tabsspaces

Page 17: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: Sequential processing

print bankstatement

print indebit column

print in credit column

print amounttransferred

print detailsof transaction

print date

print a/ctransactions

print pagebody

print pageheader

print pagesummary

printpages

Page 18: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Entity Relationship Diagrams (ERDs)

Slides on this are in a separate file.

Page 19: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Class DiagramsDerived from ERDs.

Limited to binary relationships.

ClassName

AttributeName: Type…AttributeName: Type

MethodSignature…MethodSignature

class definition

…generalizationspecialization

Diagrammatic elements:

binary relationship

RoleNameNumberConstraint

RoleNameNumberConstraint

Page 20: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: University personnel

Person

Name: String

Student

Year: Integer

Teacher

Salary: Integer

Graduate

Enroll(Course)

Course

Name: Stringgraduates

*

takes

0..4

taughtby

1..1

1..6 teaches

Page 21: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Structure Charts

Based on the fundamental notion of a module.

Used in structured systems analysis/structured design (SSA/SD).

Graph–based diagrammatic notation: a structure chart is a collection of one or more node labeled rooted directed acyclic graphs.

Each graph is a process.Nodes and modules are synonymous.A directed edge from module M1 to module M2 captures the fact

that M1 directly uses in some way the services provided by M2.

Definitions: The fan-in of a module is the count of the number of arcs directed toward the module. The fan-out of a module is the count of the number of arcs outgoing from the module.

Page 22: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: SafeHome (monitor sensors)

M1monitor sensorsexecutive

M2acquireresponse info

M4establish alarmconditions

M5alarm outputcontroller

M6produce display

M7generate alarmsignal

M8set up connectionto phone net

M9generate pulsesto line

M3read sensors

Page 23: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: SafeHome (interact with user)

M10user interactionexecutive

M11read usercommand

M12invoke commandprocessing

M18password proc.controller

M17activate/deactivate system

M13system config.controller

M14read system date

M15buildconfiguration file

M16monitor sensorsexecutive

M19read password

M20compare passwordwith file

M21password outputcontroller

M22process invalidmessage

Page 24: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

Object DiagramsDerived from structure charts.

Much in common with class diagrams.

object definition delegation

[ClassName]: ObjectName

AttributeName: Type…AttributeName: Type

MethodSignature…MethodSignature

utilization

Page 25: Design notations - David R. Cheriton School of Computer …gweddell/cs446/DesignNotatio… ·  · 2005-12-08analysis/structured design ... outside the bounds of the system to be

CS646: Software Design and Architectures

E.g.: SafeHome (interact with user)

M10user interaction

executive

M11read usercommand

M12invoke command

processing

M13system config.

controller

M15build

configuration file

M17activate/

deactivate system

M18password proc.

controller

M14read system date

M16monitor sensors

executive

M22process invalid

message

M19read password

M20compare password

with file

M21password output

controller