UML Weekend Crash Course⢠- To Parent Directory
UML Weekend Crash Course⢠- To Parent Directory UML Weekend Crash Course⢠- To Parent Directory
Session 7—Building the Use Case Narrative 71 value between 1 and 10, the second must be an integer greater than 100, and the character string can only be 30 characters in length. Without publishing these pre-conditions, anyone who wants to use your Use Case is forced into relying on trial and error to find the correct set of values. Tip Notice how rapidly we bring precision to the model from the simple beginnings of the Use Case diagram. You’ll find the analysis process akin to pulling a thread on an old sweater. If you keep pulling, eventually you’ll unravel the whole complex problem (while your mother yells at you for destroying a perfectly good sweater). Using simple checklists to remind you of the questions to ask can expedite the process and build a successful pattern of thought for problem solving. As you gain experience, modify the list of questions and tasks to improve the process and to make it your own. The goal is not to become a disciple of a particular technique, but to find a technique that works for you. Use Case initiation A Use Case has to start somehow, but how Some Use Cases start because an actor says, “Start.” For example, you can select an option on a menu. The action tells the system to open the application. Time can also trigger a Use Case. Most software shops have scheduling software that kicks off programs at a preset time. Other Use Cases are implemented as objects themselves that watch for a point in time. A Use Case may be triggered by a system event like an error condition, a lost connection, or a signal from a device. Use Case initiation provides a place to think through all the possible triggers that could launch the Use Case. This is critical when you start thinking about reusing Use Cases. If five actors and/or Use Cases plan on using the same Use Case, then you need to know how each user plans to kick it off. If each has different expectations, then you could be creating a problem. Multiple triggering mechanisms lead to high coupling and low independence. In other words, every time you change one of the triggers, you need to change the corresponding Use Case and make certain that you haven’t created problems with the other triggering mechanisms. More triggers mean more complicated and costly maintenance. Dialog The dialog refers to a step-by-step description of the conversation between the Use Case (the system) and the user (an actor or another Use Case). Very often, it is helpful to model this sequence of events using an Activity diagram just as you might model a procedure for communication between two business units. For example, you want to withdraw money, so you access the ATM at your local bank. The following dialog ensues: You get past the security check Use Case, and you’re presented with a menu of options. You choose “Withdraw.” The system immediately asks you which account you want to withdraw the money from.
72 Saturday Morning You reply that you want to withdraw from your primary checking account. The system then asks you how much you want to withdraw. You say that you want $47. The system gives you a nasty error message saying it can’t handle that number (because it’s not a multiple of 20) and you need to try again. Then you say you want $4,700. The system again complains that you can’t take that much money out in a 48-hour period. “Okay, okay! Give me $100,” you tell the system. Now the system is happy and it gives you the money and a receipt. When goals remain separate from implementation, you can evolve systems whose interface designs remain stable while their implementations take advantage of ever-improving user interface technologies. This conversation could just as easily have happened with any manufacturer’s ATM even if it held different cash denominations (10’s versus 20’s), connected directly to a bank, or connected via a nationwide network. Also, you begin to see that some of the steps don’t necessarily have to happen in the sequence presented here. The goal of the dialog is to uncover just what really needs to happen and what variations could be valid. Even ATM interface designs vary. Have you ever seen an ATM designed for blind people It performs the exact same conversation but with a different user interface. My home banking software accomplishes essentially the same function, too, but with still a different design for the interface. The system asks all the questions at once and I provide all the answers at once. Same design, different interface. Use Case termination Although there is usually only one triggering event to start a Use Case, there are often many ways to end one. You can pretty much count on some kind of normal termination where everything goes as planned and you get the result you anticipated. But things do go wrong. This could mean shutting down the Use Case with an error message, rolling back a transaction, or simply canceling. Each termination mechanism has to be addressed in the dialog. The list of termination options is a bit redundant with the dialog, but just as was the case with pre-conditions, this redundancy provides some good checks and balances. Post-conditions Post-conditions describe a state of the system that must be true when the Use Case ends. You may never know what comes after the Use Case terminates, so you must guarantee that the system is in a stable state when it does end. In fact, some people use the term guarantee for just this reason. You guarantee certain things to be true when this Use Case completes its job. You might, for instance, guarantee to give the user a receipt at the end of the transaction, whether it succeeded or failed. You might promise to notify the user of the result of an attempted save to the database.
- Page 44 and 45: Session 2—UML and Development Met
- Page 46 and 47: SESSION 3 How to Approach the UML S
- Page 48 and 49: Session 3—How to Approach the UML
- Page 50 and 51: Session 3—How to Approach the UML
- Page 52 and 53: Session 3—How to Approach the UML
- Page 54 and 55: Session 3—How to Approach the UML
- Page 56: Session 3—How to Approach the UML
- Page 59 and 60: 36 Friday Evening Remember to pay c
- Page 61 and 62: 38 Friday Evening Constraints The s
- Page 63 and 64: 40 Friday Evening An Inventory Cont
- Page 65 and 66: 42 Friday Evening Performance How
- Page 67 and 68: 44 Friday Evening In the effort to
- Page 70 and 71: Part II — Saturday Morning Sessio
- Page 72 and 73: SESSION 5 Understanding the Use Cas
- Page 74 and 75: Session 5—Understanding the Use C
- Page 76 and 77: Session 5—Understanding the Use C
- Page 78 and 79: Session 5—Understanding the Use C
- Page 80 and 81: Session 5—Understanding the Use C
- Page 82: Session 5—Understanding the Use C
- Page 85 and 86: 62 Saturday Morning Order Fulfillme
- Page 87 and 88: 64 Saturday Morning What does the
- Page 89 and 90: 66 Saturday Morning For example, th
- Page 91 and 92: 68 Saturday Morning REVIEW The goal
- Page 93: 70 Saturday Morning Much of this la
- Page 97 and 98: 74 Saturday Morning Writing a Use C
- Page 99 and 100: 76 Saturday Morning Use Case dialog
- Page 101 and 102: 78 Saturday Morning Table 7-7 The F
- Page 104 and 105: SESSION 8 Identifying the Use Case
- Page 106 and 107: Session 8—Identifying the Use Cas
- Page 108 and 109: Session 8—Identifying the Use Cas
- Page 110 and 111: Session 8—Identifying the Use Cas
- Page 112 and 113: Session 8—Identifying the Use Cas
- Page 114: Session 8—Identifying the Use Cas
- Page 117 and 118: 94 Saturday Morning The Class diagr
- Page 119 and 120: 96 Saturday Morning Attribute visib
- Page 121 and 122: 98 Saturday Morning In a modeling t
- Page 123 and 124: 100 Saturday Morning Table 9-2 Cont
- Page 125 and 126: 102 Saturday Morning Operation comp
- Page 128 and 129: SESSION 10 The Class Diagram: Assoc
- Page 130 and 131: Session 10—The Class Diagram: Ass
- Page 132 and 133: Session 10—The Class Diagram: Ass
- Page 134 and 135: Session 10—The Class Diagram: Ass
- Page 136 and 137: Session 10—The Class Diagram: Ass
- Page 138 and 139: Part II — Saturday Morning Part R
- Page 140 and 141: SESSION 11 The Class Diagram: Aggre
- Page 142 and 143: Session 11—The Class Diagram: Agg
Session 7—Building the Use Case Narrative 71<br />
value between 1 and 10, the second must be an integer greater than 100, and the character<br />
string can only be 30 characters in length. Without publishing these pre-conditions, anyone<br />
who wants to use your Use Case is forced into relying on trial and error to find the correct<br />
set of values.<br />
Tip<br />
Notice how rapidly we bring precision to the model from the simple beginnings<br />
of the Use Case diagram. You’ll find the analysis process akin to pulling a<br />
thread on an old sweater. If you keep pulling, eventually you’ll unravel the<br />
whole complex problem (while your mother yells at you for destroying a perfectly<br />
good sweater). Using simple checklists to remind you of the questions<br />
to ask can expedite the process and build a successful pattern of thought for<br />
problem solving. As you gain experience, modify the list of questions and tasks<br />
to improve the process and to make it your own.<br />
The goal is not to become a disciple of a particular technique, but to find a<br />
technique that works for you.<br />
Use Case initiation<br />
A Use Case has to start somehow, but how Some Use Cases start because an actor says,<br />
“Start.” For example, you can select an option on a menu. The action tells the system to<br />
open the application. Time can also trigger a Use Case. Most software shops have scheduling<br />
software that kicks off programs at a preset time. Other Use Cases are implemented as objects<br />
themselves that watch for a point in time. A Use Case may be triggered by a system event<br />
like an error condition, a lost connection, or a signal from a device.<br />
Use Case initiation provides a place to think through all the possible triggers that could<br />
launch the Use Case. This is critical when you start thinking about reusing Use Cases. If five<br />
actors and/or Use Cases plan on using the same Use Case, then you need to know how each<br />
user plans to kick it off. If each has different expectations, then you could be creating a<br />
problem. Multiple triggering mechanisms lead to high coupling and low independence. In<br />
other words, every time you change one of the triggers, you need to change the corresponding<br />
Use Case and make certain that you haven’t created problems with the other triggering<br />
mechanisms. More triggers mean more complicated and costly maintenance.<br />
Dialog<br />
The dialog refers to a step-by-step description of the conversation between the Use Case<br />
(the system) and the user (an actor or another Use Case). Very often, it is helpful to model<br />
this sequence of events using an Activity diagram just as you might model a procedure for<br />
communication between two business units.<br />
For example, you want to withdraw money, so you access the ATM at your local bank. The<br />
following dialog ensues:<br />
You get past the security check Use Case, and you’re presented with a menu of options.<br />
You choose “Withdraw.”<br />
The system immediately asks you which account you want to withdraw the money<br />
from.