UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory UML Weekend Crash Course™ - To Parent Directory

crnarupa.singidunum.ac.rs
from crnarupa.singidunum.ac.rs More from this publisher
01.01.2015 Views

Session 19—Applying the Collaboration Diagram to the Case Study 197 The next step in the flowchart says that the System tells the OrderFulfillmentClerk to display the Order it just found in the database. This sounds a bit odd until you realize that the OrderFulfillmentClerk represents the interface that the Order Fulfillment Clerk will use for this Use Case. So in reality, the System is telling the screen to display the data. Figure 19-6 adds the asynchronous message and line style arrow alongside sequence #1, going in the same direction between the same two objects. :OrderFullfillment Clerk :OrdersDB 1 : getOrderNbr():int 4 : return 12345678 2 : return 12345678 3 : getOrder(ordernbr.int) : Order 5 : displayOrder(Order): void :System Figure 19-6 Modeling the next step in the flowchart: Display the Order Figure 19-7 shows the completed Collaboration diagram for the first scenario. In every synchronous message, I chose to show the return as well. Many people say that you should only show the return if it isn’t obvious. Personally, Note I believe that strategy leaves a lot of room for mistaken assumptions. I also firmly believe that the purpose for modeling is to get the information out where everyone can see it. Using shortcuts hides information. For the second scenario, insert a comment referring to steps 1 through 4 of Scenario 1, and then add the new event for Scenario 2. This time the message from the System to the OrderFulfillmentClerk is an asynchronous event. The System merely sends the message and goes about its job without waiting for any reply. Figure 19-8 shows the use of the asynchronous solid line style arrow for the displayMsg(char) message.

198 Saturday Evening :OrderFullfillment Clerk :OrdersDB 1 : getOrderNbr():int 4 : return 12345678 2 : return 12345678 3 : getOrder(ordernbr.int) : Order 5 : displayOrder(Order): void :System 8: getProdSerialNbr(itemnbr.int): int 12: [product found]: fillItem(itemnbr.int): Product 12345678:Order 9: return prodserialnbr 27 15: return true 11: return true 10: [item found]getProduct(prodserialnbr.int):boolean 13: reduceInv(prod:Product):boolean 14: return true :Inventory Figure 19-7 The finished Collaboration diagram for Scenario 1 :OrderFullfillment Clerk :OrdersDB Repeat steps 1 through 4 of Scenario 1, then 1 : displayMsg(String):void :System Figure 19-8 Scenario 2 with an asynchronous event

Session 19—Applying the Collaboration Diagram to the Case Study 197<br />

The next step in the flowchart says that the System tells the OrderFulfillmentClerk to<br />

display the Order it just found in the database. This sounds a bit odd until you realize that<br />

the OrderFulfillmentClerk represents the interface that the Order Fulfillment Clerk will use for<br />

this Use Case. So in reality, the System is telling the screen to display the data. Figure 19-6<br />

adds the asynchronous message and line style arrow alongside sequence #1, going in the<br />

same direction between the same two objects.<br />

:OrderFullfillment Clerk<br />

:OrdersDB<br />

1 : getOrderNbr():int<br />

4 : return 12345678<br />

2 : return 12345678<br />

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

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

:System<br />

Figure 19-6 Modeling the next step in the flowchart: Display the Order<br />

Figure 19-7 shows the completed Collaboration diagram for the first scenario.<br />

In every synchronous message, I chose to show the return as well. Many people<br />

say that you should only show the return if it isn’t obvious. Personally,<br />

Note I believe that strategy leaves a lot of room for mistaken assumptions. I also<br />

firmly believe that the purpose for modeling is to get the information out<br />

where everyone can see it. Using shortcuts hides information.<br />

For the second scenario, insert a comment referring to steps 1 through 4 of Scenario 1,<br />

and then add the new event for Scenario 2. This time the message from the System to the<br />

OrderFulfillmentClerk is an asynchronous event. The System merely sends the message and<br />

goes about its job without waiting for any reply. Figure 19-8 shows the use of the asynchronous<br />

solid line style arrow for the displayMsg(char) message.

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

Saved successfully!

Ooh no, something went wrong!