01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

182<br />

Saturday Evening<br />

The next step is “getOrder” from the database. In the flowchart, I stated that this was a<br />

call to the Find Order Use Case. In order to keep the focus on the Sequence diagram construction,<br />

I model it here as a procedure call with a response. In Figure 17-4, steps 3 and 4 show<br />

the call and response.<br />

:OrderFulfillment Clerk :System :OrdersDB 12345678:Order 23456789:Order :Inventory<br />

1: getOrderNbr():int<br />

2: return12345678<br />

3: getOrder(ordernbr:int):Order<br />

4: return Order 12345678<br />

Figure 17-4 Add steps 3 and 4; get the Order using the order number<br />

The return is simply the data (the Order) being sent back as a result of performing the<br />

operation. Remember that the Sequence diagram is modeling a test case, so the return should<br />

be a value. Sometimes you’ll model a rule, in which case you would show the return data type<br />

rather than a specific value.<br />

The next step is “display Order.” Because this message does not require a response,<br />

Figure 17-5 shows the use of an asynchronous communication using a line-style arrow.<br />

There is no corresponding return arrow.<br />

:OrderFulfillment Clerk :System :OrdersDB 12345678:Order 23456789:Order :Inventory<br />

1: getOrderNbr():int<br />

2: return 12345678<br />

3: getOrder(ordernbr:int):Order<br />

4: return Order 12345678<br />

5: displayOrder(Order):void<br />

Figure 17-5 Add an asynchronous message.<br />

The rest of the steps are modeled in Figure 17-6. After the Order is displayed in step 5,<br />

the system asks the user for the first item to look up (step 6, getItem():int). The system is<br />

expecting to get an integer representing the number of the item on the Order to look up. It<br />

gets the reply “item #1” in step 7. The system uses the item number in step 8 to ask the<br />

Order for the corresponding product serial number. The Order returns the product serial<br />

number in step 9.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!