280 likes | 883 Views
Elementary Process Descriptions. When to use. Data flow diagrams should be decomposed until each process occurs: In one place At one time Can be completed by (logically) one person Elementary Process Descriptions are used to describe that lowest level. How to describe. Narrative
E N D
When to use • Data flow diagrams should be decomposed until each process occurs: • In one place • At one time • Can be completed by (logically) one person • Elementary Process Descriptions are used to describe that lowest level
How to describe • Narrative • Easy to write and to read • Long-winded • Sometimes ambiguous • Mathematical formulae e.g. Z notation • Precise • Compact • Unambiguous • Difficult to write and to read • Decision Tables • More later • Decision Trees • More later • Structured English • Harder to write than narrative • Shorter than narrative • Less ambiguous than narrative
Narrative for Worked Example • A warehouse receives orders from its customers which are processed as follows. Any order of £500 or more from a credit-worthy customer attracts a discount of 5% whereas orders if less than £500 attract a discount of 3%. Other circumstances must be referred to the supervisor for a decision. (so is it 3% for creditworthy customers only or 3% for everyone ordering less than £500?)
Decision Tree for Worked example Yes Yes Disc= 5% Credit OK? Order >= £500? No No Refer to super Disc= 3%
Decision Trees • Graphical representation • Includes sequence of actions and of evaluation of conditions • Scaleable i.e. suitable for small simple scenarios or large complex scenarios
Decision Tables • Easy to use • Easy to understand • Show cause and effect (of combinations of circumstances) • Can ensure all possible combinations have been considered • Do not show time sequence • Unwieldy if many conditions present
Structured English for Worked Example (1) If credit satisfactory then if order>= 500 then discount=5% else discount=3% endif else print “refer-to-super.” endif Other statements available: • Case • Do..while • Repeat....until
Structured English • Shorter than narrative • Less ambiguous • Ready to convert to program code • More thought needed to write