And Franchise Colleges 10 THE DATA DICTIONARY : Process Descriptors By MANSHA NAWAZ Section 10 Data Dictionary - Process Descriptors 1 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 Section 10 Data Dictionary - Process Descriptors 2 Lecture Outline • • • • • Process descriptors in a data dictionary internal process mini-specs vocabulary of structured english sequence, selection & iteration local variables Section 10 Data Dictionary - Process Descriptors 3 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 Section 10 Data Dictionary - Process Descriptors 4 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. Section 10 Data Dictionary - Process Descriptors 5 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 Name: Description: Data Inputs: Data Outputs: Variables: Mini-Spec: Section 10 Data Dictionary - Process Descriptors 6 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 • Selection • Iteration do the following in this order do this or that depending on... 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. Section 10 Data Dictionary - Process Descriptors 7 Problems with English Text • 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” Solution – Use Structured English Text Sequence - Selection - Iteration Section 10 Data Dictionary - Process Descriptors 8 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. Section 10 Data Dictionary - Process Descriptors 9 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 …. …. …. …. …. …. Section 10 Data Dictionary - Process Descriptors 10 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 Section 10 Data Dictionary - Process Descriptors 11 Selection • used when more than one possible action IF condition1 reserved word action1 indentation ELSE (condition2) not condition in () action2 indentation ENDIF end the selection • also use ELSEIF or CASE Section 10 Data Dictionary - Process Descriptors 12 Selection cont… • This shows alternatives and uses the construct words IF, ELSE and ENDIF. IF delivery 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. Section 10 Data Dictionary - Process Descriptors 13 Selection – IF • Using Structured English write an IF … ELSE … ENDIF statement to specify the process SelectMain-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 Section 10 Data Dictionary - Process Descriptors 14 Selection – Nested IF 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 Section 10 Data Dictionary - Process Descriptors 15 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 Section 10 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 16 Iteration • This is used for loops or repetitions – when action to be carried – Repeat Until or Do While REPEAT statement1 ... UNTIL condition reserved word indentation end condition example REPEAT DO Calculate-Invoice-Total Print Invoice UNTIL no more Sales-Details Section 10 DOWHILE condition reserved word statement1 indentation ... ENDDO end condition example DOWHILE more Sales-Details DO Calculate-Invoice-Total Print Invoice ENDDO Data Dictionary - Process Descriptors 17 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 Section 10 Data Dictionary - Process Descriptors 18 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 Section 10 Data Dictionary - Process Descriptors 19 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 is Fish-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 Section 10 Data Dictionary - Process Descriptors 20 Document : Design Specification – Data Dictionary • • • • Data Stores - Structures & Elements Data Flow - Structures & Elements Data Stores and Flow Usage Process Descriptions – NORMALISATION lecture 08 lecture 08 lecture 08 lecture 09 lecture 10 lecture 11 • Database Tables derived from Data Store Descriptions Section 10 Data Dictionary - Process Descriptors 21 Document : Data Dictionary – Data Dictionary • • • • Data Stores - Structures & Elements Data Flow - Structures & Elements Data Stores and Flow Usage Process Descriptions lecture 08 lecture 08 lecture 08 lecture 09 lecture 10 – For each process list » Process Usage & Mini Spec » Process Screen Shot Section 10 Data Dictionary - Process Descriptors 22 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. Section 10 Data Dictionary - Process Descriptors 23 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 Section 10 Data Dictionary - Process Descriptors 24
© Copyright 2025 Paperzz