sif8035 - department of computer science (idi) - ntnusif8035/pdf/flesn/f4.pdf · sif8035 lecture 4...

Post on 13-Jul-2018

220 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

SIF8035

Lecture 4

DFD and PrM

Events and System Requirements

• Events– Occurrences at a specific time and place

– Trigger all system processing

• Requirement definition– Determine relevant events

• External events first

• Temporal events second

– Decompose system into manageable units

2

Types of events• External events are initiated from outside the system by

external agents or actors– A customer orders products– A customer cancels an order

• Temporal events are triggered by a point of time– The manager requires a monthly production

statement– Invoices must be generated at 3pm

• State events trigger processes based on a system’s changefrom one state or condition to another – something frominside the system

– Manager changes production schedule– Quantity of item falls below re-order level

Naming an Event

– The event name should reveal the system natureof the event

• External event– External agent name followed by a reason

CUSTOMER REQUESTS ACCOUNT BALANCE

• Temporal event– Time to followed by action that must be taken

TIME TO BILL CUSTOMER ACCOUNTS

3

Events Affecting a Charge AccountProcessing System

Satzinger et al. Fig 5-6

External Event Checklist

Satzinger et al. Fig 5-7

4

Satzinger et al. Fig 5-8

Temporal Event Checklist

Satzinger et al. Fig 5-9

Actions Leading to Only One EventAffecting the System

5

Satzinger et al. Fig 5-10

“Transactions” for One CustomerResulting in Many Events

Satzinger et al. Fig 5-14

An Event Table

Also see Satzinger et al. Fig 5-15 for complete event table

6

Satzinger et al. Fig 6-3

DFD Fragment for the event:“Look up item availability”

Satzinger et al. Fig 6-4

DFD Integrates Event Table andERD

7

DFD Fragments

• Represents system response to one event within asingle process symbol

• Self contained model

• Focuses attention on single part of system

• Shows only data stores required to respond toevents

Satzinger et al. Fig 6-10

Two DFD Fragments for Order-Entry System

8

Satzinger et al. Fig 6-11

Combining DFD Fragments

Satzinger et al. Fig 6-13

Detailed Diagram for Create New Order

9

Decomposing DFD Fragments

• Usually, DFD fragments need to beexplored in more detail

• Broken into sub-processes with additionaldetail

10

11

Documentation of DFD Components:Rule Modeling

– Lowest level processes need to be described indetail

– Data flow contents need to be described

– Data stores need to be described

– Various options for process definition exist

Structured English

• Method of writing process specificationsthat combines structured programmingtechniques with narrative English– Well suited to lengthy sequential processes or

simple control logic

– Ill-suited for complex decision logic or fewsequential processing steps

12

Satzinger et al. Fig 6-20

Structured English Process Description

1. Sequence– A sequence of simple, declarative sentences – one

after another.

– Each sentence uses strong, action verbs such asGET, FIND, DELETE, CREATE, READ,UPDATE, etc

– A formula may be included as part of a sentence CALCULATE grosspay = hoursworked * hourlywage

13

2. A selection (conditional or decision structure )indicates that a process must perform differentactions under specified conditions.

– The IF-THEN-ELSE allows achoice between twoalternatives

• The CASE construct is used when there are morethan two sets of actions to choose from.

• For logic that is deeply nested use a decision table

3. An iteration (or repetition) structurespecifies that a set of actions should berepeated based on some stated condition.

• The DO-WHILE construct indicates that certainactions are repeated zero, one, or more timesbased on the value of the stated condition.

• The REPEAT-UNTIL constructs indicates thatcertain actions are repeated one or more timesbased on the value of the stated condition.

14

DO WHILE there are claims remainingIF claimant has not sent in a claim

set up a new claimant recordELSE continueADD claim to YTDClaimIF claimant has policyA THEN subtract excess of $400 from claimELSE subtract excess of $100 from claim

ENDIF …….

…….ENDDO

Decision Tables and Decision Trees

• Can summarize complex decision logicbetter than structured English

• Incorporates logic into the table or treestructure to make descriptions morereadable

15

Get up decision 1 2 3 4 5Y Y Y Y NY N Y Y -Y - N Y -

able to ignore? Y - - N -X X X

time to get up?tired?

anything planned?

sleepget up X X

Will I get up and go to class?

Decision Trees

• Decision trees are also useful when complexbranching occurs, in a particular order, in astructured decision process

1

2

6

5

4

3Action 1Condition 1

Condition 2

Condition 4

Condition 3Action 2

Action 3

Action 4

16

Credit limit exceeded

Good paymenthistory

Purchase >$200 - refuse credit

Credit limitnot exceeded

Bad paymenthistory

Refuse credit

Allow credit

Purchase < $200 - refer to boss

Can I purchase goods on credit?

Data Dictionary

• A Data Flow Diagram shows an overview of aninformation system without the clutter of details

• A Data Dictionary is used to document thedetailed descriptions

– of the data that flows through aninformation system and

– the data that is stored by that system

17

Data Dictionary

... an organised listing of all the data elementsthat are pertinent to the system, with precise,rigorous definitions so that both user and systemsanalyst will have a common understanding of allinputs, outputs, components of stores, andintermediate calculations.

(Yourdan 1989, p189)

• A Data Dictionary contains ‘metadata’;– Data Flows

– Data Records

– Data Elements

– Data Stores

• Data Dictionaries can vary from a stand alonedictionary to those that are fully automated(CASE tools)

18

Data Dictionary Notation

Symbol

=

+

( )

{ }

[ ]

* *

@ (or underline)

Meaning

is composed of

and

optional

iteration

selection

comment

identifier (key field)

Examples;• StudentName = * A students name*

CourtesyTitle + FirstName + (MiddleName) +LastName

CourtesyTitle = [Mr. | Mrs. | Ms. | Miss | Dr. | Professor]FirstName = {legal-character}MiddleName = {legal-character}LastName = {legal-character}legal character = [A-Z | a-z]

• Order = * A customer order* OrderNo + OrderDate + Department + CustomerNo + {[Item|Service] + Cost} + TotalCost

19

5.3Compute Current

Pay Amounts

Hours worked

WageInformation

Current PayAmounts

Wage Information = RateofPay + Overtime

Current Pay Amounts =

GrossPay +

TaxDeduction +

SuperDeduction +

NetPay

Structured Program Design

• How do you use DFD diagram toimplement software?

• Structured programming– modules, subprograms (subroutines)

– subprogram structure diagrams

• transform analysis– link between DFD and structure diagrams

20

Structure Diagram

A

B

A

B

callingsubprogram

calledsubprogram

optional

Example with communicationarrows

21

Transform analysis

• map functionalspecification toprogrammodules

• include controlrelationships,communication,…

Enter &Verifyorder

Enter &Edit new

VerifyCust credit

Read orderfrom db.

Edit OrderRead cust.data

Rejectorder…..

note optionalprocedure call(DFD?)

Software design

• high subprogram cohesion

• low subprogram coupling

• good structure– hierarchical

– simple interfaces

– …..

22

PPP – Phenomenon, Process &Program

• better integration of notations

• more expressive notations

• 3 submodels– Phenomenon model (PhM) [ER++]

– Process Model (PrM) [DFD++]

– Process Life Description (PLD)

• more comprehensive code generatrion

DFD: missing detail

• temporal specification– start/stop

– sequence

• computinginput/output relations

• marking of”resources”

A2.1

TT

T

projectleader tool report

23

24

PLD – Process Life Description

PrM to PLD

25

Constructivity

• A system’s properties can be formallyderived from statements of components’structural relationships and components’properties

26

PPP elements

top related