Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2008 Prentice Hall, Ovidiu Noran Lecture 7a 1 Modelling Logic Requirements (Textbook Chapter 8)

Similar presentations


Presentation on theme: "© 2008 Prentice Hall, Ovidiu Noran Lecture 7a 1 Modelling Logic Requirements (Textbook Chapter 8)"— Presentation transcript:

1 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 1 Modelling Logic Requirements (Textbook Chapter 8)

2 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 2 Learning Objectives Use Structured English as a tool for representing steps in logical processes in data flow diagrams. Use decision tables to represent the logic of choice in conditional statements. Select among Structured English and decision tables for representing processing logic.

3 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 3 Logic Modelling Data flow diagrams do not show the logic inside the processes or the contents of data flows. Logic modelling involves representing internal structure and functionality of processes depicted on a DFD. Logic modelling can also be used to show when processes on a DFD occur. Data modelling is used to represent the contents and structure of the DFD data flows & data stores. Data Modelling is covered in 2002ICT.

4 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 4 Modelling a System’s Logic

5 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 5 Deliverables and Outcomes Structured English representation of process logic. Decision Tables representation. Sequence diagram (mainly OO approach). Activity diagram (mainly OO approach).

6 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 6 Modelling Logic with Structured English Structured English: modified form of English language used to specify the logic of information system processes. No single standard. Typically relies on action verbs and noun phrases and contains no adjectives or No specific standards.

7 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 7 Recall the DFDs previously presented... The Hoosier Burger Example

8 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 8 … and the resulting Level-0 Diagram

9 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 9 Modelling Logic with Structured English The Hoosier Burger Inventory Control System

10 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 10 Modelling Logic with Structured English (cont.)

11 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 11 Modelling Logic with Structured English (cont.)

12 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 12 Repetition can also be modelled using DO- WHILE: Modelling Logic with Structured English READ Inventory records WHILE NOT End-of-File DO BEGIN IF IF Quantity-in-Stock is less Minimum-order-quantity THEN GENERATE new order ELSE DO nothing // optional END IF END DO What is the difference to DO-UNTIL ??

13 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 13 Cascading IF-THEN tests or a case statement can be combined to cover other possibilities. E.g. imagine modelling an emergency reorder: Modelling Logic with Structured English READ Quantity-in-Stock SELECT CASE CASE 1 (Quantity-in-Stock greater then Minimum-order-quantity) DO nothing CASE 2 (Quantity-in-Stock equals Minimum-order-quantity) DO nothing CASE 3 (Quantity-in-Stock is less than Minimum-order-quantity) GENERATE new order CASE 4 (Stock Out) INITIATE emergency reorder routine END CASE

14 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 14 Modelling Logic with Decision Tables Research (Yourdon, 1989) has shown people become confused when trying to interpret more than three nested IF-THENs. Thus, diagrams are more appropriate for complicated decision logic. A Decision table is a matrix representation of the logic of a decision which specifies the possible conditions for the decision and the resulting actions.

15 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 15 Modelling Logic with Decision Tables (cont.)

16 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 16 Modelling Logic with Decision Tables (cont.) Condition stubs: that part of a decision table that lists the conditions relevant to the decision. Action stubs: that part of a decision table that lists the actions that result for a given set of conditions.

17 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 17 Modelling Logic with Decision Tables (cont.) Rules: that part of a decision table that specifies which actions are to be followed for a given set of condition. Indifferent condition: in a decision table, a condition whose value does not affect which actions are taken for two or more rules.

18 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 18 Modelling Logic with Decision Tables (cont.) Procedure for Creating Decision Tables  Name the condition and the values that each condition can assume.  Name all possible actions that can occur.  List all possible rules.  Define the actions for each rule.  Simplify the table.

19 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 19 Modelling Logic with Decision Tables (cont.) “IF” “THEN” “IF-THEN”

20 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 20 Modelling Logic with Decision Tables (cont.) Simplified Decision Table – Staff is paid base salary, regardless

21 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 21 Modelling Logic with Decision Tables Hoosier Burger complete Decision Table

22 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 22 Modelling Logic with Decision Tables (cont.) Hoosier Burger simplified Decision Table

23 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 23 Structured English or Decision Tables? CriteriaStructured English Decision Tables Determining Conditions and Actions OkAverage Transforming Conditions and Actions into Sequence BestAverage Checking Consistency and Completeness AverageBest

24 © 2008 Prentice Hall, Ovidiu Noran Lecture 7a 24 Summary In this chapter you learned how to: Use Structured English as a tool for representing steps in logical processes in data flow diagrams. Use decision tables to represent the logic of choice in conditional statements. Select Structured English or decision tables for representing processing logic.


Download ppt "© 2008 Prentice Hall, Ovidiu Noran Lecture 7a 1 Modelling Logic Requirements (Textbook Chapter 8)"

Similar presentations


Ads by Google