240 likes | 312 Views
And Franchise Colleges. 10 THE DATA DICTIONARY : Process Descriptors. By MANSHA NAWAZ. Process Descriptors. 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
E N D
And Franchise Colleges 10 THE DATA DICTIONARY : Process Descriptors • By MANSHA NAWAZ Data Dictionary - Process Descriptors
Process Descriptors • 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 Data Dictionary - Process Descriptors
Lecture Outline • Process descriptors in a data dictionary • internal process mini-specs • vocabulary of structured english • sequence, selection & iteration • local variables Data Dictionary - Process Descriptors
NOTE • 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 Data Dictionary - Process Descriptors
Data Dictionary – Process Descriptors • 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
Process Descriptors • 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 Data Dictionary - Process Descriptors
Mini Spec - Structured English • 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. Data Dictionary - Process Descriptors
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 TextSequence - Selection - Iteration Data Dictionary - Process Descriptors
Sequence A series of imperative statements, for example: Calculate-Discount Get price given item-no Multiply quantity by price giving gross Multiply gross by 0.1 giving discount Invoice-total = gross – discount price, item-no, quantity, gross, discount and invoice-total are all DD terms, whose meanings have already been defined. Data Dictionary - Process Descriptors
Sequence cont.. • 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-no Multiply quantity by price giving gross DO Calculate-Discount Invoice-total = gross – discount …. …. …. …. …. …. Data Dictionary - Process Descriptors
Sequence Example • 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-Meal DO Select-Main-Ingredient DO Cook-Dish Data Dictionary - Process Descriptors
Selection • used when more than one possible action IF condition1 reserved word action1 indentation ELSE (condition2) not condition in () action2 indentation ENDIFend the selection • also use ELSEIF or CASE Data Dictionary - Process Descriptors
Selection cont… • This shows alternatives and uses the construct words IF, ELSE and ENDIF. IFdelivery is local Add £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. Data Dictionary - Process Descriptors
Selection – IF • 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. Answer Select-Main-Ingredient IF Guest is Carnivore Main-Ingredient = ‘Chicken’ ELSE Main-Ingredient = ‘Vegetables’ ENDIF Data Dictionary - Process Descriptors
Selection – Nested IF We can nest IF constructs, for example: IF delivery is local IFOrder-value > £50 Add £1 to Invoice-Total ELSE Add £5 to Invoice-Total ENDIF ELSE Add £20 to Invoice-Total ENDIF Data Dictionary - Process Descriptors
Selection – Case Rather than use a series of IF constructs we can use the CASE .construct for clarity: 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 Data Dictionary - Process Descriptors
Iteration • This is used for loops or repetitions • when action to be carried • Repeat Until or Do While DOWHILE conditionreserved word statement1 indentation ... ENDDOend condition example DOWHILE more Sales-Details DO Calculate-Invoice-Total Print Invoice ENDDO REPEATreserved word statement1 indentation ... UNTIL conditionend condition example REPEAT DO Calculate-Invoice-Total Print Invoice UNTIL no more Sales-Details Data Dictionary - Process Descriptors
Iteration Example • 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. Answer Cook-Dish Add Oil to Wok Heat Oil Add Ingredients to Wok DO WHILE Ingredients NOT Cooked Heat Oil Cook Ingredients ENDDO Data Dictionary - Process Descriptors
Local Variables • sometimes a local variable is used • placeholder for a value & make clearer • defined within the process specification SET subtot = 0 REPEAT Add (qty*unitprice) to subtot UNTIL no more orderitems SET total = subtot Data Dictionary - Process Descriptors
Complete Structured English DO Stir-Fry-Meal Stir-Fry-Meal DO Select-Main-Ingredient DO Cook-Dish Select-Main-Ingredient DO CASE CASE Guest is Carnivore : Main-Ingredient = ‘Chicken’ CASE Guest isFish-Eater Main-Ingredient = ‘Prawns’ OTHERWISE Main-Ingredient = ‘Vegetables’ END CASE Cook-Dish Add Oil to Wok Heat Oil Add Ingredients to Wok DO WHILE Ingredients NOT Cooked Heat Oil Cook Ingredients ENDDO Data Dictionary - Process Descriptors
Document : Design Specification • 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 Data Dictionary - Process Descriptors
Document : Data Dictionary • 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 Data Dictionary - Process Descriptors
Summary • 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. Data Dictionary - Process Descriptors
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 Data Dictionary - Process Descriptors