Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

22
Logic Modeling MIS 322

Transcript of Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Page 1: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Logic Modeling

MIS 322

Page 2: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Why do we need Logic Modeling?Lets look at the following DFD

CustomerOrder

Receipt

Food Order

Management Reports

1

Receive &TransformCustomerFood Order

2

UpdateGoods SoldFile

3

UpdateInventoryFile

4

ProduceManagementReports

CUSTOMER

RESTAURANTMANAGER

KITCHEN

GoodsSold

InventoryData

D1Goods Sold File

D2Inventory FileFormatted

GoodsSold Data

Daily Goods Sold Amounts Daily Inventory DepletionAmounts

FormattedInventory Data

Page 3: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Why do we need Logic Modeling? (contd.)

DFDs are very good for identifying processes, but they do not show the logic inside the processes What occurs within a process? How is data input converted in to output? Processes in DFDs appear as little more than black

boxes It is important to understand the structure and

functionality of a system’s processes before it can be translated into a programming language

Page 4: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

What is Logic Modeling?

It involves the representation of the internal structure and functionality of the processes on data flow diagrams

It is effective for communicating with users (who provide the business logic) and the programmers (who implement this logic into a programming language) (Whitten, Bentley, and Dittman 2004)

Page 5: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Logic Modeling Approaches Structured English to represent

process logic Decision Tables Decision Trees

Page 6: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Structured English

a technique for representing the "processing" contents of a DFD process

It has the advantages of natural English and the rigor of some of the programming language tools (Whitten et al. 2004)

Example... Show processing logic for a bank's service

charge calculation Process: Calculate Customer Service

Charge

Page 7: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Example of one form of the process

READ summary of customer monthly balances

BEGIN IFIF daily-balance is < 300 for any given day

THEN set service-charge to $5ELSE set service-charge to $0

END IF

Page 8: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

CONDITIONAL STATEMENTS

READ Quantity-in-stockSELECT CASE

CASE 1 (Quantity-in-stock greater than 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 re-order routine

END CASE

Page 9: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

REPETITION

DOREAD Inventory records

BEGIN IFIF Quantity-in-stock is less than

Minimum-order-quantityTHEN GENERATE new orderELSE DO nothing

END IFUNTIL End-of-file

Page 10: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

1

UpdateInventoryAdded

2

UpdatedInventoryUsed

3

GenerateOrders

4

GeneratePayments

Suppliers

D2Inventory

Stock onHand

Invoices

AmountsAdded

Counts

AmountsUsed

MinimumOrderQuantities

InventoryLevels

Orders

PaymentsInvoices

Page 11: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Process 1.0 -- Update Inventory Added

DOREAD next Invoice-item-recordFIND matching Inventory-recordADD Quantity-added from Invoice-item-record to Quantity-in-stock on Inventory-record

UNTIL End-of-file

Page 12: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Process 2.0 -- Update Inventory Used

DOREAD next Stock-item recordFIND matching Inventory-recordSUBTRACT Quantity-used from Stock-item-record from Quantity-in-stock

UNTIL End-of-file

Page 13: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Process 4.0 -- Generate Payments

READ Today’s-dateDO

SORT Invoice-records by DateREAD next Invoice-recordBEGIN IF

IF Date is 30 days or greater than Today’s-date

THEN GENERATE PaymentsEND IF

UNTIL End-of-file

Page 14: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

DECISION TABLES

a matrix representation of the logic of a decision ACTION STUBS

The part of a decision table that lists the actions that result for a given set of conditions.

CONDITION STUBS The part of a decision table that lists the

conditions relevant to the decision. RULES

The part of a decision table that specifies which action items are to be followed for a given set of conditions.

Page 15: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

Condition Stubs

Action Stubs

Page 16: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

CONSTRUCTING DECISION TABLES

1. Name the conditions and the values each condition can assume2. Name all possible actions that can occur3. List all possible rules4. Define the actions for each rule5. Simplify the decision table

Page 17: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

INDIFFERENT CONDITION

In a decision table, a condition whose value does not affect which actions are taken for two or more rules.

Page 18: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.
Page 19: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.
Page 20: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.
Page 21: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

DECISION TREES

A graphical representation of a decision situation in which decision points (nodes) are connected together by arcs (one for each alternative decision) and terminate in ovals (the action which is the result of all the decisions made on the path that leads to that oval).

Page 22: Logic Modeling MIS 322. Why do we need Logic Modeling? Lets look at the following DFD.

1

2

Sleep 2 more hours

Time to get up

Go back to sleep

Sleep 1 more hour

Yes

No

Sunday

Weekday

Saturday

Legend:1) Sun up?2) What day is it?