tutorial 7 logic requirements (textbook chapter 8 & appendix)

25
© 2008 Prentice Hall, Ovidiu Noran Tutorial 7 1 Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

Upload: idola-wilkinson

Post on 02-Jan-2016

22 views

Category:

Documents


1 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 1

Tutorial 7

Logic Requirements

(Textbook Chapter 8 & Appendix)

Page 2: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 2

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.

Page 3: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 3

Represent the decision logic below in Structured English

Ch. 8, Ex. 1:Part 1: Decision Logic

Page 4: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 4

Possible solution:Ch. 8, Ex. 1 (cont.):

BEGIN IFIF Employee-Type is SalaryTHEN PAY base salary

END IFBEGIN IF

IF Employee-Type is Hourly AND Hours-Worked is <40THEN CALCULATE hourly wage AND PRODUCE Absence Report

END 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

Page 5: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 5

Generate Structured English and Decision table logic modelling for some processes described in the DFD below

Ch. 8, Ex. 2 (part):

Page 6: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 6

Structured English representation for process 5.0:

Ch. 8, Ex. 2 (cont.):

DOACCEPT Inventory-record-idREAD Inventory-record for Inventory-record-idPRINT Quantity-in-stock and Inventory-item-name

UNTIL End-of-file

Decision table for process 4.0:Rules

Conditions/Courses of Action 1 2 3

Due Status L D N Generate Rush Payment X Generate Payment X Postpone Payment X Due status: L = Late; Date of invoice is more than 30 days before today's date. D = Due; Date of invoice is 30 days before today's date. N = Not due: Date of invoice is less than 30 days before today's date.

Page 7: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 7

What types of questions need to be asked during reqs. determination to gather the logic modelling information?

Ch. 8, Ex. 3:

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?

Page 8: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 8

Use Structured English to represent the logic in the following narrative:

Ch. 8, Ex. 4:

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.

Page 9: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 9

(Main)

BEGIN IFIF Purchase-amount is greater than $15,000.00THEN Purchasing–Department APPROVES RFP

DO Bid ProcessELSE Purchasing-Department APPROVES Purchase

PURCHASE equipmentEND IF

(Bid Process)SEND RFPBEGIN IF

IF three Proposals receivedAND Winning-Vendor is APPROVED by Purchasing-Department AND no Violations

THEN AWARD contract PURCHASE equipmentELSE DO Rebid Process

END IFRETURN

Ch. 8, Ex. 4 (cont.):

Page 10: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 10

(Rebid Process)

SEND RFPBEGIN IF

IF Winning-Vendor is APPROVED by Purchasing-DepartmentAND no Violations

THEN AWARD contract PURCHASE equipment

END IFISSUE Purchase OrderRETURN

Ch. 8, Ex. 4 (cont.)

Page 11: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 11

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?

Rules Conditions/Courses of Action 1 2 3 4 Purchase Amount G L G L Vendor Approved Y Y N N Award Contract to Winning Vendor

X

Issue Purchase Order X X Purchase Equipment X X Award Contract to Other Approved Vendor

X

Find Another Approved Vendor

X

Purchase Amount: G = greater than $15,000.00, L = less than or equal to $15,000.00 Vendor Approved: Y = Yes; approved by Purchasing Department N = No; not approved by Purchasing Department

Page 12: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 12

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

Page 13: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 13

The Hire Employee use case / scenario

Part 2: Seq. & Activity Diagrams

Page 14: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 14

Assume there is only one scenario within the use case.

1. On receipt of a job application, the applicant data is entered through the application entry window

2. The manager opens the app review window and reviews the application

3. If the initial review is negative, the manager discards the app and conveys the rejection decision to applicant

4. 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

5. The manager interviews the candidate and enters the info the application file

6. 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

7. 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.

Page 15: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 15

Sequence Diagram for Hire Employee

Explicitly shown externalactor

Decision logic

Decision logic

:

Page 16: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 16

Ch. 8 App, Ex. 4 Draw an activity diagram for the previous employee

hiring process.

Page 17: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 17

Human Resources

DepartmentManager

Enter applicant data

Review application

Send outcome to applicant

Ask for references

Set up Interview

Hold interview

Create potential

employee file

reject

-ve

+ve

Produce Summary

accept

Human Resources

DepartmentManager

Enter applicant data

Review application

Send outcome to applicant

Ask for references

Set up Interview

Hold interview

Create potential

employee file

reject

-ve

+ve

Produce Summary

accept

Page 18: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 18

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

Case Study: Pine Valley Furniture (PVF)

Part 3

Page 19: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 19

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

Page 20: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 20Level-0 data flow diagram for the PVF WebStore

Page 21: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 21

PVF: Logic Modelling

Page 22: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 22

E-commerce App: Logic Modelling

Process 3 decomposition DFD for the PVF WebStore

Page 23: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 23

E-commerce App: Logic Modelling

Page 24: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 24

E-commerce App: Logic Modelling

Page 25: Tutorial 7 Logic Requirements (Textbook Chapter 8 & Appendix)

© 2008 Prentice Hall, Ovidiu NoranTutorial 7 25

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.