
Chapter 9 Working with Object-Oriented Models
Linking a class or interface to a use case
A use case can be used and expanded in class diagrams to describe how the use case is implemented by one or several classes, or one or several interfaces.
Implementation Classes
The Implementation Classes tab in the use case property sheet shows the list of classes, or interfaces used to implement a use case. A use case is generally a task or service, represented as a verb. When analyzing what a use case must do, it is necessary to identify the classes and interfaces that need to be created to fulfill the task.
In this logic, it is possible to create the classes or interfaces and attach them to a use case.
For example, a use case ship product by express mail needs the classes Shipping, Product, and Billing to perform its task. They are shown as related to the use case in the figure below.
To link a class or interface to a use case:
- Double-click the use case symbol to display its property sheet.
- Click the Implementation Classes tab to view the list of classes.
- Click the Add Objects tool.
A selection window is displayed listing the available classes and interfaces of the model.
Select Tools
All classes and interfaces of the model are displayed by default. Use the Include Sub-Packages tool beside the Folder Selection list to increase the selection, it allows you to include all the classes and interfaces from the packages of the model.
- Select the objects as required and click OK.
The selected objects are displayed in the list of implementation classes.
You can similarly view the name of the use case in the class property sheet: double-click the class to open its property sheet, click the Dependencies tab and select the Use Cases sub-tab. The name of the use case is automatically added in this sub-tab.
Copyright (C) 2007. Sybase Inc. All rights reserved.
|
|