260 likes | 483 Views
Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix). Learning Objectives. Practice Logic Modelling - Structured English and decision tables to representing steps in logical processes in DFDs and choice in conditional statements Practice Sequence Diagrams Practice Activity Diagrams
E N D
Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)
Learning Objectives • Practice Logic Modelling - Structured English and decision tables to representing steps in logical processes in DFDs and choice in conditional statements • Practice Sequence Diagrams • Practice Activity Diagrams • Understand how logic modeling techniques apply to the development of electronic commerce applications.
Represent the decision logic below in Structured English Part 1: Decision Logic Ch. 8, Ex. 1:
Ch. 8, Ex. 1 (cont.): • Possible solution: BEGIN IF IF Employee-Type is Salary THEN PAY base salaryEND IFBEGIN IF IF Employee-Type is Hourly AND Hours-Worked is <40 THEN CALCULATE hourly wage AND PRODUCE Absence ReportEND IFBEGIN IF IF Employee-Type is Hourly AND Hours-Worked is 40 THEN CALCULATE hourly wageEND IFBEGIN IF IF Employee-Type is Hourly AND Hours-Worked is >40 THEN CALCULATE hourly wage AND CALCULATE overtimeEND IF
Ch. 8, Ex. 2 (part): • Generate Structured English and Decision table logic modelling for some processes described in the DFD below
Ch. 8, Ex. 2 (cont.): • Decision table for process 4.0: • Structured English representation for process 5.0: DOACCEPT Inventory-record-idREAD Inventory-record for Inventory-record-idPRINT Quantity-in-stock and Inventory-item-name UNTIL End-of-file
Ch. 8, Ex. 3: • What types of questions need to be asked during reqs. determination to gather the logic modelling information? • Start with the processes represented in the DFDs. • Elicit information from users that will help model the logic within these processes and the events that initiate each process. • Determine the process decision and temporal logic involved in the users' business processes. Ask the users to literally describe what happens in each of the processes on the data flow diagrams. • when does the process occur? • what are the explicit steps? • how and by whom are they performed? • in what sequence and at what time are they performed? • are there any conditions, constraints, or contingencies on any of these steps happening? If so, what are they and how do they happen? • Observe the actual processes. Do they fit with what users describe?
Ch. 8, Ex. 4: • Use Structured English to represent the logic in the following narrative: • In a company the rules for buying perosnal computers are such that if the purchase is over $15,000 it has to go out for bid and the Request for Proposals must be approved by the Purchasing Department. If the purchase is under $15,000, the personal computers can simply be bought from an approved vendor; however, the Purchase order must still be approved by the Purchasing department. If the purchase goes out for bid, there must be at least three proposals received for the bid. If not, the RFP must go out again. If still there are not enough proposals, the process can continue with the vendors that have submitted proposals. The winner of the bid must be on an approved list of vendors for the company and, in addition, must not have any violations against them for e.g. environmental matters. At this point, if the proposal is complete, the Purchasing Department can issue a Purchase Order.
Ch. 8, Ex. 4 (cont.): (Main) BEGIN IF IF Purchase-amount is greater than $15,000.00 THEN Purchasing–Department APPROVES RFP DO Bid Process ELSE Purchasing-Department APPROVES Purchase PURCHASE equipment END IF (Bid Process) SEND RFP BEGIN IF IF three Proposals received AND Winning-Vendor is APPROVED by Purchasing-Department AND no Violations THEN AWARD contract PURCHASE equipment ELSE DO Rebid Process END IF RETURN
Ch. 8, Ex. 4 (cont.) (Rebid Process) SEND RFP BEGIN IF IF Winning-Vendor is APPROVED by Purchasing-Department AND no Violations THEN AWARD contract PURCHASE equipment END IF ISSUE Purchase Order RETURN
Ch. 8, Ex. 6 • Present the logic of business processes described in the previous exercise in a decision table. How do decision tables compare with Structured English for this example?
Ch. 8, Ex. 6 (cont.) • How do decision tables compare with Structured English for this example? • Several fairly complicated conditions are present hence the Structured English approach may be better. Several decision tables could be used as well. • Again, the decision tables are good at reviewing / optimising the decision logic but not at determining conditions and actions or at transforming conditions and actions into sequence
Part 2: Seq. & Activity Diagrams • The Hire Employee use case / scenario
Assume there is only one scenario within the use case. • On receipt of a job application, the applicant data is entered through the application entry window • The manager opens the app review window and reviews the application • If the initial review is negative, the manager discards the app and conveys the rejection decision to applicant • If initial review is positive, the manager sets up a date and time to interview the applicant. The manager also requests that the referees specified in the app provide recommendation letters • The manager interviews the candidate and enters the info the application file • When the recommendation letters come in, the manager is ready to make a decision. Based on the summary, a decision is made. If the decision is to reject, the application is discarded and the applicant is notified. The processing of the application comes to an end • If the decision is to hire the candidate, a potential employee file is created and all relevant info is entered into this file. The hiring decision is conveyed to applicant.
Sequence Diagram for Hire Employee Decision logic Explicitly shown externalactor : Decision logic
Ch. 8 App, Ex. 4 • Draw an activity diagram for the previous employee hiring process.
Part 3 Case Study: Pine Valley Furniture (PVF) • Manufactures high-quality wood furniture • Distributes to retail stores within the U.S. • Started in the early 1980s and expanded by 1984 doubling sales volume • By 1990, Pine Valley Furniture had become a complex company, employing over 50 persons
Pine Valley Furniture development methodology dictated that the logic within each unique processes be represented. Structured English was chosen for modelling the logic. PVF: Logic Modelling
E-commerce App: Logic Modelling Process 3 decomposition DFD for the PVF WebStore
Summary • In this tutorial you practiced: • Logic Modelling - Structured English and decision tables • Sequence Diagrams • Activity Diagrams • Logic modelling techniques applied to the development of electronic commerce applications.