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

Chapter 4: Use Cases and Actors

Credit System

Warehouse Manager

Shipping Service

Purchasing Manager

Add Associations

1.

Use the Unidirectional Association toolbar button to draw the association between the customer actor and the "Add Item to Shopping Cart" use case.

2.

Repeat step 1 to add the rest of the associations to the diagram.

Add Use Case Descriptions

1.

Select the "Add Item to Shopping Cart" use case in the browser.

2.

Using the documentation window, add the following description to the "Enter New Order" use case:

This use case allows the customer to add an item for sale to their shopping cart for purchase.

3.

Using the documentation window, add descriptions to the remaining use cases.

Add Actor Descriptions

1.

Select the customer actor in the browser.

2.

Using the documentation window, add the following description to the salesperson actor: The customer is the individual who is purchasing items from the organization.

3.

Using the documentation window, add descriptions to the remaining actors.

Summary

In this chapter, we discussed how to work with use cases, actors, and Use Case diagrams. The requirements of the system to be built are the set of all use cases and actors. You begin by creating a Main Use Case diagram to show the overall view of the system. Then, you can create additional diagrams to illustrate the interactions

157

Chapter 4: Use Cases and Actors

between actors and use cases. Use cases can include or extend other use cases. Otherwise, they cannot directly communicate with each other. One use case includes another when the functionality will always be needed. One use case extends another when the functionality is optionally needed. If a use case is included by or extends another use case, that use case is abstract. Use cases in which actors directly participate are concrete.

Actors can communicate with use cases, illustrating which actors participate in which use cases. Actors can also inherit from one another. For example, a student may be an actor in the system. We may need to further refine the role of student into full−time student and part−time student. We do this by inheriting the full−time and part−time students from the student actor.

Use cases and Use Case diagrams are useful ways to describe system functionality. In the next chapter, we will discuss the use of Sequence and Collaboration diagrams, which are used to show the interactions between objects and actors.

158