Defining Business Requirements using UML Use Case diagram in JDeveloper 10 g

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.

Topics

This lesson will discuss the following:

 Overview
 Prerequisites
 Step 1 - Create a new Application Workspace

Step 2 - Create a Use Case diagram

 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.


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.

 

Back to Topic List

Scenario

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.

Prerequisites

Back to Topic List

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.

 

Step 1 - Create a new Application Workspace

Back to Topic List

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.

Move your mouse over this icon to see the image


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.

Move your mouse over this icon to see the image

 

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.

Move your mouse over this icon to see the image

 

 

 

Step 2- Create the Use Case diagram

Back to Topic List

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.

Move your mouse over this icon to see the image


2.

In the New Gallery, expand the General node, select the Diagrams category and double-click the UML Use Case Diagram item.

Move your mouse over this icon to see the image

 

3.

In the Create UML Use Case Diagram dialog, enter Web Ordering as the name, and leave the default package value. Click OK.

Move your mouse over this icon to see the image

 

4.

The Web Ordering empty diagram opens.

Move your mouse over this icon to see the image

 

5.

Select Component Palette from the View menu (if it is not already open) to display the various diagram components.

Move your mouse over this icon to see the image

 

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 .


Move your mouse over this icon to see the image

 

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 .

Move your mouse over this icon to see the image

 

8.

Select the Communication icon  and draw a line between the Customer actor and the Order Products Use Case.

Move your mouse over this icon to see the image


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 .

Move your mouse over this icon to see the image

 

10.

Select the Use Case - Fully Dressed  icon and click below the Browse Product Descriptions Use Case. Change the name to Manage Shopping Cart .

Move your mouse over this icon to see the image

 

11.

Select the Use Case - Fully Dressed icon  and click below the Manage Shopping Cart Use Case. Change the name to Process Order .

Move your mouse over this icon to see the image

 

12.

Your Use Case diagram should now look like this:

Move your mouse over this icon to see the image

 

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.

Move your mouse over this icon to see the image

 

14.

Repeat the same operation to include the Manage Shopping Cart Use Case in the Orders Products Use Case.

Move your mouse over this icon to see the image

 

15.

Repeat the same operation to include the Process Order Use Case in the Orders Products Use Case.

Move your mouse over this icon to see the image

 

16.

Choose File | Save All to save all your work thus far.

Move your mouse over this icon to see the image

 

17.

Your diagram should now look like this:

Move your mouse over this icon to see the image

 

 

Step 3- Add details to diagram components

Back to Topic List

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

 


Add information to Customer definition

Back to List

1.

Double click on the Customer actor silhouette to open its definition.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

 

 

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.

Move your mouse over this icon to see the image

 

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.

Move your mouse over this icon to see the image

 

 

Add details to Use Cases

Back to List

1.

Click the Web Ordering tab on the top of the editor window to display the Web Ordering diagram.

Move your mouse over this icon to see the image

 

2.

Double click the Order Products Use Case to open it. Notice that this use case was created using the Casual icon.

Move your mouse over this icon to see the image

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.

Move your mouse over this icon to see the image

 

4.

Select the " Browse Product Descriptions" link and drop it next to the do X words. Remove the placeholder words.

Move your mouse over this icon to see the image

 

5.

Select the “ Manage Shopping Cart” link and drop it next to the do Y words. Remove the placeholder words.

Move your mouse over this icon to see the image

 

6.

Select the “ Process Order ” link and drop it next to the do Z words. Remove the placeholder words.

Move your mouse over this icon to see the image

 

7.

The Use Case should look like this:

Move your mouse over this icon to see the image

 

8.

Click on the Web Ordering tab to open the diagram in the editor.

Move your mouse over this icon to see the image

 

9.

Double click the Browse Product Definitions Use Case to open its definition.

Move your mouse over this icon to see the image

 

10.

Notice that the sections are more detailed than the previous use case. This use case was created using the Fully dressed icon.

Move your mouse over this icon to see the image

 

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.

Move your mouse over this icon to see the image

 

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

Move your mouse over this icon to see the image

 

13.

Open the Web Ordering diagram. (use the tab on the top of the editor window)

Move your mouse over this icon to see the image

 

14.

Double click on the Manage Shopping Cart Use Case to open its definition.

Move your mouse over this icon to see the image

 


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.

Move your mouse over this icon to see the image

 

16.

Open the Web Ordering diagram. (use the tab on the top of the editor)

Move your mouse over this icon to see the image

 

17.

Double click the Process Order Use Case to open its definition.

Move your mouse over this icon to see the image

 

18.

In the Scenario section, select the <<< Insert Next Element Here message, and delete it.

Move your mouse over this icon to see the image

 

19.

Add the following actions:

  1. Calculate total
  2. Register providing Username and Password
  3. Enter Delivery Address
  4. Enter Credit Card Information
  5. Submit Order

Move your mouse over this icon to see the image

 

20.

In the Precondition section add the following text:

Shopping cart is not empty
Provide username and password

Move your mouse over this icon to see the image

 

21.

In the Postcondition section, enter the following text for Minimal Guarantee(s) :

Credit card information is valid

Move your mouse over this icon to see the image


22.

In the Postcondition section, enter the following text for Success Guarantee(s) :

No products are ordered if the payment cannot be verified

Move your mouse over this icon to see the image

 

23.

Open the Web Ordering diagram in the diagram.

Move your mouse over this icon to see the image

 

24.

Choose File | Save All to save all your work thus far.

Move your mouse over this icon to see the image

 

25.

Select the text for the Process Order Use Case and change it to Finalize Order .

Move your mouse over this icon to see the image

 

26.

Double click the Order Products Use Case.

Move your mouse over this icon to see the image

 

27.

Note that the Finalize Order link in the Scenario section has been changed to the new name.

Move your mouse over this icon to see the image

 

28.

Choose File | Save All to save all your work thus far.

Move your mouse over this icon to see the image

 

 

Step 4 - Refine the Use Case diagram

Back to Topic List

In the following steps, you use Generalization and Extension to refine the Use Case.

 

1.

Open the Web Ordering diagram in the editor.

Move your mouse over this icon to see the image

 

2.

In the Component Palette, select the Actor icon  and click below the already existing Customer actor on the diagram.

Move your mouse over this icon to see the image

 

3.

Rename the new actor Actor1 to Registered Customer .

Move your mouse over this icon to see the image

 

4.

Select the Generalization icon  from the Component Palette.

Move your mouse over this icon to see the image

 

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”).

Move your mouse over this icon to see the image

 

6.

Double click on the Registered Customer silhouette to open its properties.

Move your mouse over this icon to see the image

 

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.

Move your mouse over this icon to see the image

 

8.

Open the Web Ordering diagram in the editor.

Move your mouse over this icon to see the image

 

9.

Select the Use Case - Fully dressed icon  from the Component Palette and click in the diagram below the Finalize Order Use Case.

Move your mouse over this icon to see the image

 

10 .

Change the UseCase1 name to Finalize Order For Registered Customer .

Move your mouse over this icon to see the image

 

11.

Select the Communication icon  in the Component Palette

Move your mouse over this icon to see the image

 

12.

Click in the Registered Customer silhouette as the source and draw a communication line toward Finalize Order For Registered Customer.

Move your mouse over this icon to see the image

 

13.

Select the Extension icon  in the Component Palette.

Move your mouse over this icon to see the image

 

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”).

Move your mouse over this icon to see the image

 

15.

Double click the Finalize Order For Registered Customer Use Case to display its properties.

Move your mouse over this icon to see the image

 

16.

In the Precondition enter the following text and set the block format to "paragraph":

Customer provides a valid Username and Password combination.

Move your mouse over this icon to see the image

17.

In the Scenario section, select the <<< Insert Next Element Here message, delete it and add the following text:

  1. Customer logs in and his information are retrieved
  2. New total is calculated to apply registered customer discount
  3. If credit card validation date has expired, new credit card information is requested

Move your mouse over this icon to see the image

 

18.

Open the Web Ordering diagram in the editor.

Move your mouse over this icon to see the image

 

19.

Select the Note icon  and click on the diagram below the Registered Customer.

Move your mouse over this icon to see the image

 

20.

In the text area enter the following text:

Username and password need to be valid.

Move your mouse over this icon to see the image

 

21.

Select the Attachment icon  in the Component Palette.

Move your mouse over this icon to see the image

 

22.

Draw a line from the note to Registered Customer.

Move your mouse over this icon to see the image

 

23.

Choose File | Save All to save all your work thus far.

Move your mouse over this icon to see the image

 

24.

Your diagram should now look like this:

Move your mouse over this icon to see the image

 

 

Step 5 - Generate Java Doc for the Use Case

Back to Topic List

In the following steps, you generate the documentation for the use case.

 

 Generate documentation and display it in JDeveloper
 Display documentation in a browser


Generate documentation and display it in JDeveloper

Back to List

 

1.

In the Applications Navigator, select the Project node.

Move your mouse over this icon to see the image

 

2.

From the menu, select Run | Javadoc Project.jpr option.

Move your mouse over this icon to see the image

 

3.

Open the log window View | Log.

Move your mouse over this icon to see the image

 

4.

Select the Javadoc tab in the Log window and Click on the View Documentation hyperlink.

Move your mouse over this icon to see the image

 

5 .

The editor window has navigation links generated for each component in the diagram sorted by categories.

Move your mouse over this icon to see the image

 

6.

Click on the various links to display the full properties of a component.

Move your mouse over this icon to see the image

 

7.

Notice that a new file named index.html has been generated and appears in the Applications Navigator.

Move your mouse over this icon to see the image

 

 


Display Use Case documentation in a Browser

Back to List

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.

Move your mouse over this icon to see the image

 

2.

In the Create External Tools dialog click Browse next to the Program Executable field.

Move your mouse over this icon to see the image

 

3.

Locate the browser executable in your directory structure, and click Open.

Move your mouse over this icon to see the image

 

4.

Click Insert next to the Arguments field.

Move your mouse over this icon to see the image

 

5.

Select File URL from the list, and click OK.

Move your mouse over this icon to see the image

 

6.

Click Browse button next to the Run Directory field.

Move your mouse over this icon to see the image

 

7.

In the Choose directory dialog, select {jdev_home}\jdev\mywork and click Select.

Move your mouse over this icon to see the image

 

8.

Click Next to display Step 2 of the wizard. This step doesn't require any change. Click Next again.

Move your mouse over this icon to see the image

 

9. In Step 3 of the wizard, select Navigator Context Menu.

Move your mouse over this icon to see the image

Click Next.

 

10.

In Step 4 of the wizard, select the When Specific File types are Selected option.

Move your mouse over this icon to see the image

 

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.

Move your mouse over this icon to see the image

Click OK to exit the wizard.

 

12.

In the Applications Navigator, right click index.HTML.

Move your mouse over this icon to see the image

 

13.

You should now see in the context menu a new option for Internet Explorer. Select it.

Move your mouse over this icon to see the image

 

14.

A browser opens, allowing you to browse the Use Case documentation using the links on the left frame of the page.

Move your mouse over this icon to see the image

 

 

Summary

Back to Topic List

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

 

 Move your mouse over this icon to hide all screenshots

Left Curve
Popular Downloads
Right Curve