Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
137
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Appendix: Getting Started with UML

Select the Object Flow toolbar button.

4.

Drag an arrow from an activity to the object it affects or from the object to the activity that uses the object as input.

An object is an entity affected by the workflow. It can serve as input into a process step, in which case a dashed object flow arrow is drawn from the object to the process step. Or, it can be affected by a process step, in which case an object flow arrow is drawn from the step to the object.

Follow these steps to add synchronizations to the workflow:

1.

Select the Synchronization toolbar button.

2.

Click in the diagram to place the synchronization bar.

3.

Draw a transition arrow from an activity to the synchronization bar, indicating that the parallel processing begins after that activity.

4.

Draw transition arrows from the synchronization bar to the activities that can occur in parallel.

5.

Create another synchronization bar to indicate the end of the parallel processing.

6.

Draw transition arrows from the synchronous activities to the final synchronization bar to indicate that the parallel processing stops once all of those activities are complete.

A synchronization indicates that two or more steps in the workflow may be completed in parallel. A synchronization bar is used to show where two or more activities may occur simultaneously. These can be very effective in analyzing the efficiency of a workflow; examining the amount of parallel activity can help to optimize a workflow.

Building a Use Case Diagram

A Use Case diagram is a graphical representation of the high−level system scope. It includes use cases, which are pieces of functionality the system will provide, and actors, who are the users of the system. Looking at a Use Case diagram, you should easily be able to tell what the system will do and who will interact with it.

679

Appendix: Getting Started with UML

You can create one or more Use Case diagrams for a single system. If you create more than one, each will show a subset of the actors and/or use cases in the system. You can also group the use cases and actors into packages to help organize the model.

The Use Case diagram can be helpful in communicating with the end users of the system. It is designed to be straightforward and nontechnical so that everyone on the team can come to a common understanding of the system scope. It is usually created by the technical team, but in conjunction with an end user representative.

To create a new Use Case diagram:

1.

Right−click a package in the Use Case view.

2.

Select New → Use Case Diagram.

A Use Case diagram shows a subset of the use cases and actors in the system. You can create as many Use Case diagrams as you need to fully document the system scope.

Follow these steps to add actors to the diagram:

1.

Determine the actors for your system.

2.

680

Appendix: Getting Started with UML

Select the Actor toolbar button.

3.

Click in the Use Case diagram to add the actor.

4.

Name the actor.

An actor is a person, system, piece of hardware, or other thing that interacts with your system.

Follow these steps to add use cases to the diagram:

1.

Add the use cases to the diagram.

2.

Select the Use Case toolbar button.

3.

Click in the Use Case diagram to add the use case.

4.

Give the use case a name.

A use case is a piece of functionality the system will provide. It is usually named in the format <verb><noun>, such as "Deposit Check" or "Withdraw Cash." Use cases are high−level and implementation−independent.

To add relationships between the actors and use cases:

1.

Select the Unidirectional Association toolbar button.

2.

Drag an arrow from the actor to the use case.

A communicates relationship between an actor and a use case indicates that the actor initiates the use case. An actor may initiate one or more use cases.

681

Appendix: Getting Started with UML

To add includes relationships between appropriate use cases:

1.

Select the Include Use Case toolbar button.

2.

Drag an arrow from a use case to the use case it includes.

An includes relationship suggests that one use case must include another. In other words, running one use case means that the other must be run as well. One use case may be included by one or more other use cases.

To add extends relationships between appropriate use cases:

1.

Select the Extend Use Case toolbar button.

2.

Drag an arrow from the extending use case to the use case it extends.

An extends relationship is used when one use case optionally extends the functionality provided by another. In other words, if one use case runs, an extending use case may or may not run.

Follow these steps to group the use cases, actors, and other elements into packages:

1.

Right−click the Use Case view or another package and select New → Package.

2.

Name the new package.

3.

In the browser, drag and drop use cases, actors, Use Case diagrams, or other modeling elements into the new package.

A package is a UML mechanism used to group items together. Grouping can help to organize the model, and can also help in managing any changes in the model elements. You may nest one package inside another to further organize the model.

682

Appendix: Getting Started with UML

To add generalization relationships between appropriate use cases:

1.

Select the Generalization toolbar button.

2.

Drag an arrow from the child use case to the parent use case.

A generalization relationship between two use cases indicates that one use case (the child) inherits all of the functionality provided by the other use case (the parent).

To add generalization relationships between appropriate actors:

1.

Select the Generalization toolbar button.

2.

Drag an arrow from the child actor to the parent actor.

A generalization relationship between actors indicates that one actor (the child) inherits the characteristics of another actor (the parent). The child actor may initiate all of the use cases that the parent can initiate.

683