Agenda l Overview of Requirements Structuring l Logic & Event-Response Modeling –Structured English –Decision Tables –Decision Trees l Exercises
Learning Objectives l Use Structured English, decision tables, decision trees for logic modeling l Select among each logic modeling techniques
Structuring System Requirements l Models for –Data movement (DFD, process model) –Data structure and rules (ERD, business rules) –Processing logic and rules (this chapter) l Need all these types of models to get a more complete picture for code generation
Logic & Event-Response Modeling l Rules which govern the manipulation of data within system processes (typically primitive processes ) l Rules which govern what actions are taken under what conditions/events l Common notations are: –Structured English –Decision trees –Decision tables
Modeling Logic with Structured English l Modified form of English used to specify the logic of information processes l Uses a subset of English –Action verbs –Noun phrases –No adjectives or adverbs l No specific standards
Structured English is used here to refer to input.
Structured English is used here to describe arithmetic operations.
Structured English is used here to describe repetition.
Structured English is used here to describe decisions.
Structured English is used here to describe invoking other processes.
Decision Tables What are they? When would they be useful (what situations or types of decisions?) How might a decision table be represented within programming code?
Decision Table Simplification
Modeling Logic with Decision Trees l A graphical representation of a decision situation l Decision situation points are connected together by arcs and terminate in ovals l Main components –Decision points represented by nodes –Actions represented by ovals –Particular choices from a decision point represented by arcs
Decision tree representation of salary decision
Decision Tree for Prior Problem a.Graphical tool--can be used to represent the same information as shown on the decision table -Nodes -Branches b.How can decision trees be different than decision tables? c.Construct a decision tree for decision table problem
Which Tool Do I Use? CriteriaStructured English Decision Tables Decision Trees Determining conditions & actions Transforming conditions & actions into a sequence Checking consistency & completeness
Policy Modeling Example Travel Reimbursement Policy : First we determine if it is a local trip. If it is, we only pay mileage of 18.5 cents a mile. If the trip was a one-day trip, we pay mileage and then check the times of departure and return. In order to reimbused for breakfast, you must leave by 7am and return later than 10am; for lunch, leave by 11am and return later than 2pm; and for dinner, leave by 5pm and return later than 7pm. On a trip lasting more than one day, we allow hotel, taxi, and airfare, as well as meal allowances as indicated above. Write a decision table. Write a decision tree. Write structured English Which do you prefer? Why?
More Practice Exercises l Problems & Exercises 11, 13 (pp. 261) –Develop Structured English routine(s) –Develop decision table(s) –Develop decision tree(s)
Summary l 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 and decision trees to represent logical choice in conditional statements. Select among structured English, decision tables, and decision trees.