Defining Business Requirements using UML Use Case diagram
in JDeveloper 10g
Purpose
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 tutorial takes approximately half an hour to complete.
Viewing Screenshots
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.
Overview
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.
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.
.(Notice that the directory name changes to match the new name.) For the
application template, select
No Template [All Technologies], and click OK.
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
in the Component Palette and click in the left part of the diagram surface.
Replace the default Actor1 name with Customer.
7.
Select the Use Case - Casual icon
and drag it from the Component palette to the right of the Customer silhouette.
Rename it to Order Products.
8.
Select the Communication icon
and draw a line between the Customer actor and the Order Products Use
Case.
9.
Select the Use Case - Fully Dressed
icon and drag it to the right of the Order Products Use Case. Change the
name to Browse Product
Descriptions.
10.
Select the Use Case - Fully Dressed
icon and click below the Browse Product Descriptions Use Case. Change
the name to Manage Shopping
Cart.
11.
Select the Use Case - Fully Dressed icon
and click
below the Manage Shopping Cart Use Case. Change the name to
Process Order.
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
in the Component Palette and draw a line from the Order Products
Use Case to the Browse Product Descriptions Use Case.
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.
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
icon in the editor toolbar to replace the numbering by a bulleted list.
12.
In the Scenario
section, below the usecase_includes add the following
description for the use case:
Browse product
catalog
Check details
of selected products (description, unit price and available quantity)
Add product to shopping
cart
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
to replace the numbering by a bulleted list. In
the Scenario section, below the usecase_includes
add the following description for the use case:
When
the customer selects a product to fill his shopping cart, each selection
creates an entry in the shopping cart with a default quantity of one
unit. When viewing the shopping cart content, the customer has the
opportunity to update the quantity.
The customer may also want to delete an item in his shopping cart.
He can either specify a null quantity or delete a product line in
the shopping cart.
At any
time, the customer is kept informed of the value of his shopping
cart.
When
the customer finally agree with the number of items in his shopping
cart and the shopping cart value, he can then confirm the order.
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:
Calculate total
Register providing
Username and Password
Enter Delivery
Address
Enter Credit Card
Information
Submit Order
20.
In the Precondition section add the following
text:
Shopping cart is not
empty Provide
username and password
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.
1.
Open the Web Ordering diagram
in the editor.
2.
In the Component Palette, select the Actor
icon and click
below the already existing Customer actor on the diagram.
3.
Rename the new actor Actor1 to Registered
Customer.
4.
Select the Generalization icon
from the Component Palette.
5 .
Click in the Registered Customer silhouette
as the source and draw a Generalization line toward
Customer. (Hint: the arrow head of the generalization
should be pointing to “Customer”, not “Registered
Customer”).
6.
Double click on the Registered Customer
silhouette to open its properties.
7.
In the Background and skills section
below the actor_profile reference cut and paste the
following text:
A registered customer
is a customer that has previously ordered products from our site.The
customer has already provided a username and password, and the system
tracks of the customer's address and credit card information. A registered
customer is eligible for a discount.
8.
Open the Web Ordering diagram in the
editor.
9.
Select the Use Case - Fully dressed icon
from the
Component Palette and click in the diagram below the Finalize
Order Use Case.
10 .
Change the UseCase1 name to Finalize
Order For Registered Customer.
11.
Select the Communication icon
in the Component Palette
12.
Click in the Registered Customer silhouette
as the source and draw a communication line toward
Finalize Order For Registered Customer.
13.
Select the Extension icon
in the Component Palette.
14.
Click in the Finalize Order For Registered Customer
Use Case and draw an Extension line toward the Finalize
Order Use Case. (Hint: the arrow head of the extension should
be pointing to “ finalize order”, not “ Finalize Order
For Registered Customer”).
15.
Double click the Finalize Order For Registered
Customer Use Case to display its properties.
16.
In the Precondition enter the following
text and set the block format to "paragraph":
Customer provides a
valid Username and Password combination.
17.
In the Scenario section, select the <<<
Insert Next Element Here message, delete it and add the following
text:
Customer logs in and his information are retrieved
New total is calculated to apply registered customer discount
If credit card validation date has expired, new credit card
information is requested
18.
Open the Web Ordering diagram in the
editor.
19.
Select the Note icon
and click on the diagram below the Registered Customer.
20.
In the text area enter the following text:
Username and password
need to be valid.
21.
Select the Attachment icon
in the Component Palette.
22.
Draw a line from the note to Registered Customer.
23.
Choose File | Save All to save all your
work thus far.
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
to move them in the Selected Types list , Click Finish.