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.

150<br />

Saturday Afternoon<br />

have currently modeled it. It’s all part of the validation process. Each diagram lends a new<br />

perspective to the information about the system.<br />

A workflow-level Activity diagram represents the order in which a set of Use Cases is executed.<br />

An Activity diagram for one Use Case would explain how the actor interacts with the<br />

system to accomplish the goal of the Use Case, including rules, information exchanged,<br />

decisions made, and work products created.<br />

Modeling the user’s work this way does not bind you to that particular version of the<br />

process. Remember that for each goal (Use Case), there may be any number of valid<br />

processes. But creating such a model will likely reveal the essential elements of the process<br />

in a way that is familiar to the users. The new presentation then facilitates the interview to<br />

clarify the tasks and the reasons behind them. This is your opportunity to ask those allimportant<br />

“why” questions to get at the goal of the process and each task used to perform<br />

the process.<br />

Defining methods<br />

The Activity diagram can also be used to model the implementation of complex methods.<br />

When defining the implementation for an operation, you need to model the sequence of<br />

data manipulation, looping, and decision logic. Modeling complex functions can prevent<br />

problems later when you write the code by revealing all the requirements explicitly in the<br />

diagram. Models make most, if not all, of your assumptions visible and consequently easier<br />

to review and correct.<br />

That last statement is worth emphasizing. It is very tempting to shortcut the<br />

modeling process, but the true value of modeling is in revealing what you<br />

Tip know so that it can be challenged and verified. Making assumptions sabotages<br />

this very valuable benefit of modeling.<br />

The Activity diagram contains all the logical constructs you find in most programming<br />

languages. In fact, it can translate quite well into pseudo-code or even native code.<br />

I should offer one clarification here regarding the vocabulary of the <strong>UML</strong>. The word operation<br />

in the <strong>UML</strong> refers to the declaration portion of a behavior defined by a class. This typically<br />

means the name, parameters, and possibly the return type. This is also often called<br />

the interface, the information you use to tell the object what you want it to do.<br />

In contrast, the word method is used to refer to the implementation of an operation, the<br />

code that is executed when you invoke the interface. The Activity diagram may be used to<br />

design the requirements for a method. Because the <strong>UML</strong> does not provide a place to model<br />

the methods in a Class diagram, or anywhere else, the Activity diagram can fill in this missing<br />

piece.<br />

Tip<br />

Not everyone has accepted or uses the definitions for operation and method<br />

as they are used in the <strong>UML</strong>.<br />

<strong>To</strong> be sure, not every operation is complicated enough to warrant drawing an Activity<br />

diagram. The point is that the Activity diagram is well suited to the task when it is needed.

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

Saved successfully!

Ooh no, something went wrong!