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 8—Identifying the Use Case Scenarios 83 the logic expressed in the Use Case narrative and the scenarios; the places where you grapple with business objectives; and your plans to cope with all these issues to ensure the success of the system. Having said this, I want to voice a caution: You can dissect Use Cases endlessly looking for anything and everything possible. But you want to avoid analysis paralysis by recognizing that you won’t get everything right the first time through. It just isn’t possible. Allow for a number of passes through the problem with limited time frames. Move on to other diagrams and revisit the Use Cases and scenarios after looking at the problem from the unique perspectives that the other diagrams provide. Let the diagrams reveal information and inconsistencies, or prove you right. Above all, allow time for practice. Trial and error can be excellent teachers. How to find Use Case scenarios So how do you find these scenarios Reading a narrative and following every possible path can be difficult sometimes. One very simple and practical tool to use to find the scenarios visually is an Activity diagram. I almost always draw Activity diagrams rather than rely solely on text. Visual models provide a valuable complement to text. Together, the two perspectives can reveal insights not visible from only one perspective. Given that people learn in different ways, having different tools to explain the problem can help everyone grasp the important issues more easily. One major benefit of an Activity diagram is its ability to quickly reveal dead-end segments and incomplete paths. The Activity diagram is still grounded in textual description for each activity, so there is significant overlap that helps ensure that your information is consistent. Cross-Ref If you aren’t comfortable with flowcharts or Activity diagrams, you may want to skip ahead to Sessions 14 and 15 before finishing this chapter. To find a scenario, start at the beginning. It usually works best to follow the path of the successful scenario first since it will usually be the most comprehensive. Trace the steps until you come to a decision, represented by a diamond. Now you have to make a choice. Select one of the possible paths leading out of the diamond, preferably the path that leads to the successful completion of the scenario, and continue to trace the steps. Continue the process until you reach an end point. That is Scenario 1. Now return to the top and retrace the first scenario to the first branching point (decision). Start the second scenario at the branch, but follow a different path leading out of the decision. Continue tracing the steps as before. If you loop back to a place you have already been, then stop. Avoid creating redundant segments. Repeat the process until you have traced a path through every segment of the diagram. You should now have a set of segments that together account for every element of the Activity diagram.

84 Saturday Morning Finding Use Case scenarios for the case study Now that you have an understanding of what a scenario is and how to find one, I want to walk you through the case study Use Case “FillOrder.” Table 8-1 contains the dialog portion of the Use Case narrative for FillOrder (created in Session 7) that will be the basis for the Activity diagram to follow. Table 8-1 Use Case Narrative for FillOrder Field Name Use Case dialog Field Description The system asks the user for an order number. The user provides the order number. The system asks for the order (from LocateOrder Use Case). If the Order is not found, Error, stop. Else: The system provides the order to the user. The user chooses an item. Until the user indicates that she is done or there are no unfilled item quantities greater than 0: The system asks for the location of the item and unfilled quantity (from the LocateProduct Use Case). If the item is found (available): The user indicates the quantity of the item filled. If there are any unfilled item quantities greater than 0: Create a backorder (using the CreateBackorder Use Case).

84<br />

Saturday Morning<br />

Finding Use Case scenarios for the case study<br />

Now that you have an understanding of what a scenario is and how to find one, I want to<br />

walk you through the case study Use Case “FillOrder.” Table 8-1 contains the dialog portion<br />

of the Use Case narrative for FillOrder (created in Session 7) that will be the basis for the<br />

Activity diagram to follow.<br />

Table 8-1<br />

Use Case Narrative for FillOrder<br />

Field Name<br />

Use Case dialog<br />

Field Description<br />

The system asks the user for an order number.<br />

The user provides the order number.<br />

The system asks for the order (from LocateOrder Use<br />

Case).<br />

If the Order is not found, Error, stop.<br />

Else:<br />

The system provides the order to the user.<br />

The user chooses an item.<br />

Until the user indicates that she is done or there are no<br />

unfilled item quantities greater than 0:<br />

The system asks for the location of the item and<br />

unfilled quantity (from the LocateProduct Use Case).<br />

If the item is found (available):<br />

The user indicates the quantity of the item filled.<br />

If there are any unfilled item quantities greater than 0:<br />

Create a backorder (using the CreateBackorder Use<br />

Case).

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

Saved successfully!

Ooh no, something went wrong!