Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And...

24
Section 10 Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ

Transcript of Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And...

Page 1: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

1

10 THE DATA DICTIONARY

: Process Descriptors

And Franchise Colleges

By MANSHA NAWAZ

Page 2: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

2

• Aim– to be able to construct an internal process

mini-spec using structured english

• Objectives– to identify the necessary sequence of actions– to identify any optional paths of action– to identify any possible iterative actions– to record using given syntax

Process Descriptors

Page 3: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

3

• Process descriptors in a data dictionary

• internal process mini-specs

• vocabulary of structured english

• sequence, selection & iteration

• local variables

Lecture Outline

Page 4: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

4

• Programmers– you will have awareness of structured english

• Non-Programmers– descriptions are sufficient

• Also consideration– storyboards– screen design– bullet point description – address what needs to be done for the process

NOTE

Page 5: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

5

• The connection between the DFD and DD for processes is as follows: – we record a Process Specification for each process

on the DFD that isn’t exploded.

• English is very ambiguous and would lead to long-winded and unclear process specifications.

• We want something clearer and more concise.• Structured English is widely used in structured

methods.

Data Dictionary – Process Descriptors

Page 6: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

6

Process Descriptors

DATA DICTIONARY: PROCESS DESCRIPTORS

Name:

Description:

Data Inputs:

Data Outputs:

Variables:

Mini-Spec:

• Show how something is to be done within a process• Techniques covered is based the below form• Mini Spec is where we describe the action in terms of an algorithm or

structured english• Structured English revolving around sequence, selection & iteration

instructions

Page 7: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

7

• Mini Spec or Process Specification is a form of English with a limited number of constructs and a limited vocabulary.

• Most programs, like data structures, are made up of:• Sequence do the following in this order

• Selection do this or that depending on...

• Iteration keep doing this until...

• Within the Mini-Spec or process specifications we will use:• Imperative verbs, like multiply, print, add, create or update• Data dictionary terms member, book.author, order• reserved words IF...THEN, READ• Mathematical symbols• Labels• A little English or text for readability

• According to convention, data dictionary terms are underlined and construct words are written in CAPITALS.

Mini Spec - Structured English

Page 8: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

8

• ambiguous– x and (y or z) OR– (x and y) or z?

• vague– what is a good

payment history?

• too long

“customers who place more than £10,000 of orders per year and have a good payment history or have been with us more than 20 yrs are to receive 10% discount on all orders”

Problems with English Text

Solution – Use Structured English Text Sequence - Selection - Iteration

Page 9: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

9

A series of imperative statements, for example:

Calculate-DiscountGet price given item-noMultiply quantity by price giving grossMultiply gross by 0.1 giving discountInvoice-total = gross – discount

price, item-no, quantity, gross, discount and invoice-total are all DD terms, whose meanings have already been defined.

Sequence

Page 10: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

10

• Process specifications are often written in a hierarchical, top-down fashion, like the way sets of DFDs are developed by explosion.

• To this end, DO followed by a label is used to carry out a block of statements at a lower level.…. …. …. …. …. ….DO Calculate-Invoice-Total…. …. …. …. …. ….Calculate-Invoice-Total

Get price given item-noMultiply quantity by price giving grossDO Calculate-DiscountInvoice-total = gross – discount…. …. …. …. …. ….

Sequence cont..

Page 11: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

11

• Given the top-level statement DO Stir-Fry-Meal and using Structured English, write two DO statements to specify the process Stir-Fry-Meal, which consists of 2 parts, one to select the main ingredient and one to cook the dish.

Answer

Stir-Fry-MealDO Select-Main-IngredientDO Cook-Dish

Sequence Example

Page 12: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

12

• used when more than one possible actionIF condition1 reserved word

action1 indentation

ELSE (condition2) not condition in ()

action2 indentation

ENDIF end the selection

• also use ELSEIF or CASE

Selection

Page 13: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

13

• This shows alternatives and uses the construct words IF, ELSE and ENDIF.

IF delivery is localAdd £5 to invoice-total

ELSE (delivery not local)Add £20 to invoice-total

ENDIF

• Note how indentation is used to help the meaning.• Also, note how the reverse of the original condition is

stated for the ELSE part for clarity.• Whilst optional, this is good practice.

Selection cont…

Page 14: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

14

• Using Structured English write an IF … ELSE … ENDIF statement to specify the process Select-Main-Ingredient.

If a guest is a meat eater, the main ingredient will be chicken. Otherwise the main ingredient will be vegetables.

DD terms already defined are Guest, Carnivore and Main-Ingredient.

AnswerSelect-Main-Ingredient

IF Guest is CarnivoreMain-Ingredient = ‘Chicken’

ELSEMain-Ingredient = ‘Vegetables’

ENDIF

Selection – IF

Page 15: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

15

We can nest IF constructs, for example:

IF delivery is local

IF Order-value > £50

Add £1 to Invoice-Total

ELSE

Add £5 to Invoice-Total

ENDIF

ELSE

Add £20 to Invoice-Total

ENDIF

Selection – Nested IF

Page 16: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

16

IF constructs:

IF X = 1

Add B to A

ENDIF

IF X = 2

Add C to A

ELSE

Add D to A

ENDIF

Case constructs:

DO CASE

CASE X = 1

Add B to A

CASE X = 2

Add C to A

OTHERWISE

Add D to A

ENDCASE

Rather than use a series of IF constructs we can use the CASE .construct for clarity:

Selection – Case

Page 17: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

17

• This is used for loops or repetitions– when action to be carried – Repeat Until or Do While

Iteration

REPEAT reserved word

statement1indentation

...UNTIL condition end condition

example

REPEAT

DO Calculate-Invoice-Total

Print Invoice

UNTIL no more Sales-Details

DOWHILE condition reserved word

statement1 indentation

...ENDDO end condition

example

DOWHILE more Sales-DetailsDO Calculate-Invoice-TotalPrint Invoice

ENDDO

Page 18: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

18

• Using Structured English specify the process Cook-Dish. • You need a sequence for adding oil to the wok, heating

the oil, then adding the ingredients, followed by an iteration while you stir fry the ingredients until they’re cooked.

• DD terms already defined are Oil, Wok and Cooked.

Iteration Example

Cook-Dish Add Oil to Wok Heat Oil Add Ingredients to WokDO WHILE Ingredients NOT Cooked

Heat Oil Cook Ingredients

ENDDO

Answer

Page 19: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

19

• sometimes a local variable is used – placeholder for a value & make clearer

• defined within the process specificationSET subtot = 0

REPEAT

Add (qty*unitprice) to subtot

UNTIL no more orderitems

SET total = subtot

Local Variables

Page 20: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

20

DO Stir-Fry-MealStir-Fry-Meal

DO Select-Main-IngredientDO Cook-Dish

Select-Main-IngredientDO CASE

CASE Guest is Carnivore :Main-Ingredient = ‘Chicken’

CASE Guest is Fish-EaterMain-Ingredient = ‘Prawns’

OTHERWISEMain-Ingredient = ‘Vegetables’

END CASE

Cook-DishAdd Oil to Wok Heat Oil Add Ingredients to Wok

DO WHILE Ingredients NOT CookedHeat Oil

Cook Ingredients ENDDO

Complete Structured English

Page 21: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

21

– Data Dictionary lecture 08

• Data Stores - Structures & Elements lecture 08

• Data Flow - Structures & Elements lecture 08

• Data Stores and Flow Usage lecture 09

• Process Descriptions lecture 10

– NORMALISATION lecture 11

• Database Tables derived from Data Store Descriptions

Document : Design Specification

Page 22: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

22

– Data Dictionary lecture 08

• Data Stores - Structures & Elements lecture 08

• Data Flow - Structures & Elements lecture 08

• Data Stores and Flow Usage lecture 09

• Process Descriptions lecture 10

– For each process list» Process Usage & Mini Spec» Process Screen Shot

Document : Data Dictionary

Page 23: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

23

• Process specifications are formed by combining sequence, selection and iteration constructs.– DO is used to structure the specification, using labels.– Construct words are written in CAPITALS.– Data dictionary terms are underlined.– Imperative verbs are used, plus a little English for readability and

some mathematical notation.– Process specifications are not at the detailed program coding level.

• Structured English is recommended as a process specification tool because:– It uses standard constructs and rules, making it clear and concise. – It uses data dictionary terms, making it precise. – To remove ambiguity, it uses nesting and the normal computer

rules of precedence, ie ANDs are evaluated before ORs.

Summary

Page 24: Section 10Data Dictionary - Process Descriptors 1 10 THE DATA DICTIONARY : Process Descriptors And Franchise Colleges By MANSHA NAWAZ.

Section 10 Data Dictionary - Process Descriptors

24

Further Reading

• Notes from Annette Marshall on Data Dictionary

• http://outranet.scm.tees.ac.uk/users/u0018257/SDV/SDevWk6.doc• http://outranet.scm.tees.ac.uk/users/u0018257/SDV/SDevWk6a.doc

• http://outranet.scm.tees.ac.uk/users/u0018257/SDV/SDevWk7.doc• http://outranet.scm.tees.ac.uk/users/u0018257/SDV/SDevWk7a.doc