testcontent
This tutorial describes how to create a UML Use Case Diagram to define Business Requirements. UML Use Case Diagrams describe the functionality of a system in a horizontal way. UCDs (Use Case Diagrams) can be used to show a high level vision of the available functionality of an application. However, they do not show the order or number of times the system actions should be executed. Further, UCDs should not be used to describe exception behavior.
To help you define the scope of a use case, keep in mind that a use case starts with triggering events, and finishes when the actor goals are satisfied and the expected event response is achieved.
This lesson will discuss the following:
| |
Overview | |
| |
Prerequisites | |
| |
Step 1 - Create a new Application Workspace | |
| |
||
| |
Step 3 - Add details to diagram components | |
| |
Step 4 - Refine the Use Case diagram | |
| |
Step 5 - Generate Java Doc for the Use Case | |
| |
Summary | |
Time to complete
This tutorial takes approximately half an hour to complete.
Move your mouse over this icon to show all screenshots. You can also move your mouse over each individual icon to see only the screenshot associated with it.
The goal of this tutorial is to teach you how to create a Use Case Diagram and how to use Use Case Components to describe how a user interacts with the system you are building.
Based on the common schema foundation and more specifically on the Order Entry sub system, this use case represents a fictitious web application allowing customers to order products.
Before starting this tutorial, you should have completed the following:
| 1. |
Install Oracle JDeveloper 10g . |
Although this tutorial is based on the common schema for the scope of the business, it does not require any database resource.
When you work in JDeveloper, you organize your work in projects within application workspaces. JDeveloper provides a number of predefined templates that allow you to create a workspace and projects that are configured for developing the type of application you are working on. The templates provide the basic range of technologies needed for an application. You create your working environment by selecting the template that fits your application type, and adding any additional technologies as necessary.
However, In this tutorial you are going to choose the No Template option.
| 1. |
In the Applications Navigator, right-click
Applications and choose
New Application Workspace from the context menu.
|
| 2. |
In the
Create Application Workspace dialog, rename the application
Application1 to
ProductOrdering.
|
| 3. |
The ProductOrdering workspace is created and displayed as a node in the navigator. A default project named Project has also been added. Save your work by clicking on the Save All button. You should save your work at regular intervals as you work through the rest of this tutorial.
|
In this step, you use Actor, Communication, Use Case and Include components for your diagram.
An Actor represents an external role that interacts with the system.
A Use Case is a description of a major function that the system performs for external actors. In JDeveloper, you have the choice between the Casual or the Fully Dressed use case. The second one supports more details in its description.
| 1. |
Select the
Project node in the Navigator, and right-click to choose
New to display the New Gallery.
|
| 2. |
In the New Gallery, expand the General node, select the Diagrams category and double-click the UML Use Case Diagram item.
|
| 3. |
In the Create UML Use Case Diagram dialog, enter Web Ordering as the name, and leave the default package value. Click OK.
|
| 4. |
The Web Ordering empty diagram opens.
|
| 5. |
Select Component Palette from the View menu (if it is not already open) to display the various diagram components.
|
| 6. |
Select the
Actor icon
|
| 7. |
Select the
Use Case - Casual icon
|
| 8. |
Select the
Communication icon
|
| 9. |
Select the
Use Case - Fully Dressed
|
| 10. |
Select the
Use Case - Fully Dressed
|
| 11. |
Select the
Use Case - Fully Dressed icon
|
| 12. |
Your Use Case diagram should now look like this:
|
| 13. |
Since the Order Products Use Case includes all three other use cases on the diagram, do the following: Select the
Inclusion icon
|
| 14. |
Repeat the same operation to include the Manage Shopping Cart Use Case in the Orders Products Use Case.
|
| 15. |
Repeat the same operation to include the Process Order Use Case in the Orders Products Use Case.
|
| 16. |
Choose File | Save All to save all your work thus far.
|
| 17. |
Your diagram should now look like this:
|
In this step, you add details to the components drawn on the diagram to complete their definitions and clarify the Use Case.
| |
Add information to Customer definition | |
| |
Add details to Use Cases | |
| 1. |
Double click on the Customer actor silhouette to open its definition. |
| 2. |
In the Responsibilities section, click next to the bullet below actor_responsibilities, and enter the following text: As the user has validated his order, he becomes a "de facto" customer.
|
| 3. |
In the Background and skills section, under the actor_profile, enter the following text: The term Customer applies to anyone connecting to our merchant site on the web. Therefore, anyone is a prospective customer.
|
| 4. |
In the Referenced By section notice the link to Order Products. This was automatically created when you added the Communication line on the diagram.
|
| 1. |
Click the Web Ordering tab on the top of the editor window to display the Web Ordering diagram.
|
| 2. |
Double click the Order Products Use Case to open it. Notice that this use case was created using the Casual icon. Click the Editor tab to open the editor view.
|
| 3. |
In the Scenario section you can see that references to the other use cases are included. Just above the reference to Browse Product Descriptions, cut and paste the following description for the scenario: Customer connects to our merchant site home page to order products. The home page displays product categories allowing customer to
do X through categories links. The customer may also use a direct link to
do Y and change quantities or remove a product. When the customer has finished shopping, he can then
do Z to validate the purchase.
|
| 4. |
Select the "
Browse Product Descriptions" link and drop it next to the
do X
words. Remove the placeholder words.
|
| 5. |
Select the “ Manage Shopping Cart” link and drop it next to the do Y words. Remove the placeholder words.
|
| 6. |
Select the “ Process Order ” link and drop it next to the do Z words. Remove the placeholder words.
|
| 7. |
The Use Case should look like this:
|
| 8. |
Click on the Web Ordering tab to open the diagram in the editor.
|
| 9. |
Double click the Browse Product Definitions Use Case to open its definition.
|
| 10. |
Notice that the sections are more detailed than the previous use case. This use case was created using the Fully dressed icon.
|
| 11. |
In the
Scenario section, select the
<<< Insert Next Element Here message, delete it and click on the
Unordered list
|
| 12. |
In the Scenario section, below the usecase_includes add the following description for the use case:
|
| 13. |
Open the
Web Ordering diagram. (use the tab on the top of the editor window)
|
| 14. |
Double click on the Manage Shopping Cart Use Case to open its definition.
|
| 15. |
In the
Scenario section, select the
<<< Insert Next Element Here message, delete it and click on the
Unordered list icon
|
| 16. |
Open the
Web Ordering diagram. (use the tab on the top of the editor)
|
| 17. |
Double click the Process Order Use Case to open its definition.
|
| 18. |
In the Scenario section, select the <<< Insert Next Element Here message, and delete it.
|
| 19. |
Add the following actions:
|
| 20. |
In the Precondition section add the following text: Shopping cart is not empty
|
| 21. |
In the Postcondition section, enter the following text for Minimal Guarantee(s) : Credit card information is valid |
| 22. |
In the Postcondition section, enter the following text for Success Guarantee(s) : No products are ordered if the payment cannot be verified
|
| 23. |
Open the Web Ordering diagram in the diagram.
|
| 24. |
Choose File | Save All to save all your work thus far.
|
| 25. |
Select the text for the Process Order Use Case and change it to Finalize Order .
|
| 26. |
Double click the Order Products Use Case.
|
| 27. |
Note that the Finalize Order link in the Scenario section has been changed to the new name.
|
| 28. |
Choose File | Save All to save all your work thus far.
|
In the following steps, you use Generalization and Extension to refine the Use Case.
In the following steps, you generate the documentation for the use case.
| |
Generate documentation and display it in JDeveloper | |
| |
Display documentation in a browser | |
| 1. |
In the Applications Navigator, select the Project node.
|
| 2. |
From the menu, select Run | Javadoc Project.jpr option.
|
| 3. |
Open the log window View | Log.
|
| 4. |
Select the Javadoc tab in the Log window and Click on the View Documentation hyperlink.
|
| 5 . |
The editor window has navigation links generated for each component in the diagram sorted by categories.
|
| 6. |
Click on the various links to display the full properties of a component.
|
| 7. |
Notice that a new file named index.html has been generated and appears in the Applications Navigator.
|
To complete the following steps, you need to add your browser as a plug in to your JDeveloper environment. The following example illustrates the use of Internet Explorer as the Browser tool.
| 1. |
In the menu select Tools | External tools..., and click Add in the dialog.
|
| 2. |
In the Create External Tools dialog click Browse next to the Program Executable field.
|
| 3. |
Locate the browser executable in your directory structure, and click Open.
|
| 4. |
Click Insert next to the Arguments field.
|
| 5. |
Select File URL from the list, and click OK.
|
| 6. |
Click Browse button next to the Run Directory field.
|
| 7. |
In the Choose directory dialog, select {jdev_home}\jdev\mywork and click Select.
|
| 8. |
Click Next to display Step 2 of the wizard. This step doesn't require any change. Click Next again.
|
| 9. | In
Step 3 of the wizard, select
Navigator Context Menu.
Click Next.
|
| 10. |
In Step 4 of the wizard, select the When Specific File types are Selected option.
|
| 11. |
In the Available types list, select
HTML Source and
XHTML Source and use the Move button
Click OK to exit the wizard.
|
| 12. |
In the Applications Navigator, right click index.HTML.
|
| 13. |
You should now see in the context menu a new option for Internet Explorer. Select it.
|
| 14. |
A browser opens, allowing you to browse the Use Case documentation using the links on the left frame of the page.
|
In this tutorial you've learned how to:
Create a new application workspace
Create a Use Case diagram
Add details to diagram components
Refine a Use Case diagram
Generate Java Doc for a Use Case
Related topics
N/A