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 5—Understanding the Use Case Model 55 Withdraw Cash Update Account Withdraw Cash with Overdraft Protection Protect Overdraft Figure 5-6 Use Case notation for the Use Case diagram By defining Use Cases in this manner, the system is defined as a set of requirements rather than a solution. You do not describe how the system must work. You describe what the system must be able to do. The Use Cases describe only those features visible and meaningful to the actors who use the system. Keeping this in mind will help you avoid functional decomposition, the breaking down of procedures and tasks into smaller and smaller processes until you have described all the internal workings of the system. One of the pitfalls of systems development is going over budget, which happens when you don’t limit the scope of each task or you make a model too inclusive. The UML provides seven diagrams, in addition to the Use Case Model, for fully describing the solution for the system, so remember that you can save some work for later. Tip One very common question about Use Cases is, “What requirements belong on the Use Case diagram and what requirements should be explained elsewhere” The simplest answer I’ve found is, “Model only the features of the system that can be seen by an actor.” For example, the system must save data to a database, but the actor can’t actually see this happening. The most they typically see is a message indicating that it did. In this situation, the Use Case level requirement is a message indicating success or failure on the save function, not the save function itself. Use Case relationships So far, I’ve defined the system, actors, and Use Cases, but now you need to associate each user with the system features they need to perform their jobs.

56 Saturday Morning Association notation A line connecting an actor to a Use Case represents an association, as shown in Figure 5-7. The association represents the fact that the actor communicates with the Use Case. In fact, in earlier versions of the UML spec, this was called a Communicates With relationship. This is the only relationship that exists between an actor and a Use Case. According to the UML spec, you may specify a directionality arrow on either end of the association line to denote the direction of the communication. Some associations are unidirectional (for example, the actor specifies information to the Use Case). Most associations are bidirectional (that is, the actor accesses the Use Case, and the Use Case provides functionality to the actor). For bidirectional associations, you may either place an arrowhead on both ends of the association line, or simply show no arrowheads at all. For simplification, most users tend to show no arrowheads at all. Most modeling tools provide the option to turn bidirectional arrows on or off. Just remember that the key is to identify which Use Cases the actors need to access. These connections will form the basis for the interfaces of the system and subsequent modeling efforts. Customer Withdraw Cash Update Account Withdraw Cash with Overdraft Protection Protect Overdraft Figure 5-7 Association notation for the Use Case diagram Stereotype notation The stereotype notation is used throughout the UML, very commonly on Use Case dependencies, classes, and packages and other elements of the UML known as classifiers. The standard notation is to enclose the word in guillemets > (French quote marks), as in the notation below. Stereotypes provide a means to extend the UML without modifying it. A stereotype functions as a qualifier on a model element, providing more information about the role of the element without dictating its implementation. dependency notation Sometimes one Use Case may need to ask for help from another Use Case. For example, Use Cases titled Deposit Money and Withdraw Money may not actually update a bank account. They may delegate the changes to an existing Use Case called Update Account so that changes are controlled through a single feature that guarantees that all changes are done correctly.

Session 5—Understanding the Use Case Model 55<br />

Withdraw Cash<br />

Update Account<br />

Withdraw Cash<br />

with Overdraft<br />

Protection<br />

Protect Overdraft<br />

Figure 5-6 Use Case notation for the Use Case diagram<br />

By defining Use Cases in this manner, the system is defined as a set of requirements rather<br />

than a solution. You do not describe how the system must work. You describe what the system<br />

must be able to do. The Use Cases describe only those features visible and meaningful to<br />

the actors who use the system. Keeping this in mind will help you avoid functional decomposition,<br />

the breaking down of procedures and tasks into smaller and smaller processes until<br />

you have described all the internal workings of the system. One of the pitfalls of systems<br />

development is going over budget, which happens when you don’t limit the scope of each<br />

task or you make a model too inclusive. The <strong>UML</strong> provides seven diagrams, in addition to the<br />

Use Case Model, for fully describing the solution for the system, so remember that you can<br />

save some work for later.<br />

Tip<br />

One very common question about Use Cases is, “What requirements belong<br />

on the Use Case diagram and what requirements should be explained elsewhere”<br />

The simplest answer I’ve found is, “Model only the features of the<br />

system that can be seen by an actor.”<br />

For example, the system must save data to a database, but the actor can’t<br />

actually see this happening. The most they typically see is a message indicating<br />

that it did. In this situation, the Use Case level requirement is a<br />

message indicating success or failure on the save function, not the save<br />

function itself.<br />

Use Case relationships<br />

So far, I’ve defined the system, actors, and Use Cases, but now you need to associate each<br />

user with the system features they need to perform their jobs.

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

Saved successfully!

Ooh no, something went wrong!