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

Chapter 4: Use Cases and Actors

Draw transitions from activities to the decision, or from the decision to one or more activities. Place guard conditions on all transitions leaving the decision, so the reader can know under what conditions each path is followed.

Deleting Activity Diagrams

To delete an activity diagram, simply right−click it in the browser and select Delete. Note that, although the diagram has been deleted, all of the activities and other elements on the diagram are still in the Rose model. You can see these elements in the browser.

To delete all of the elements that were on the diagram, right−click each element one at a time in the browser and select Delete. Or, you can right−click the State/Activity Model listing for the use case in the browser and select Delete. All activity diagrams, along with all activities and other items on the diagrams for that use case, will be deleted from the model.

Note The activity diagram must stay where it was created. You cannot move an activity diagram from one use case, class, or package to another. Also remember that you cannot copy a state or other element from one activity diagram to another.

Exercise

In this exercise, we'll create the Use Case diagram for the order−processing system.

Problem Statement

After Andy and April got the business model done, Andy started working on the Use Case diagram for the e−business system. Andy started by looking at each of the business use cases and deciding which ones would be best automated with the e−business system. He decided that the "Purchase Items," "Purchase Inventory," "Stock Inventory," "Determine Items to Sell," and "Fulfill Order" business use cases would be best automated in the system. Andy started working out the system use cases and system actors based on the business use cases and actors involved. He then developed the system use case model based on this information and interviews with others in the firm.

Create a Use Case Diagram

Create the Use Case diagram for the order−processing system. The steps for creating the diagram are outlined below. Your final Use Case diagram should look like Figure 4.22.

154

Chapter 4: Use Cases and Actors

Figure 4.22: E−Business System Use Case diagram

Exercise Steps:

Add the System Use Case Model Package, Use Case Diagram, Use Cases, and Actors

1.

Right−click the Use Case View package in the browser and select New → Package.

2.

Name the new package System Use Case Model.

3.

Right−click the System Use Case Model package and select New → Use Case Diagram.

4.

Name the new diagram Main.

5.

Double−click the Main Use Case diagram in the browser to open the diagram.

6.

Use the Use Case toolbar button to add a new use case to the diagram.

7.

155

Chapter 4: Use Cases and Actors

Name this new use case Add Item to Shopping Cart.

8.

Repeat steps 6 and 7 to add the remaining use cases to the diagram. The use cases are:

View Shopping Cart

View Details of Items

Purchase Items in Shopping Cart

Remove Item from Shopping Cart

Browse Items for Sale

Provide Feedback

Stock Inventory

Return Item to Stock

Ship Order

Add New Item for Sale

Remove Item for Sale

Purchase Inventory

9.

Use the Actor toolbar button to add a new actor to the diagram.

10.

Name this new actor Customer.

11.

Repeat steps 9 and 10 to add the remaining actors to the diagram. The actors are:

156