JDeveloper 10gでのUMLユースケース図を使用したビジネス要 件の定義

このチュートリアルでは、UMLユースケース図を作成してビジネス要件を 定義する方法について説明します。 UMLユースケース図を使用すると、システムの機能を平面的に表すことができます。 また、ユースケース図は、アプリケーションの使用可能な機能を視覚的に表すために使用します。 ただし、実行するシステム・アクションの順序や回数を表示する機能はありません。 また、ユースケース図は、例外動作の記述には使用できません。

ユースケースの範囲を定義する場合、ユースケースはイベントの起動で始ま り、アクターが目的を果たし、予想したイベントのレスポンスが得られた時点で終了することに注意してください。

約30分

トピック

このレッスンの内容は次のとおりです。

概要
前提 条件
ア プリケーション作業領域の新規作成

ユースケース図の作成

図 のコンポーネントへの詳細の追加
ユー スケース図の改良
ユー スケース用のJavaDocの生成
まと め

概要

トピック・リス トに戻る

このチュートリアルでは、ユースケース図の作成方法と、ユー スケース・コンポーネントを使用してユーザーと構築中のシステムが対話する方法を説明します。

このユースケースは、共通のスキーマ(具体的には受注サブシ ステム)を基盤とした、顧客が製品を発注する架空のWebアプリケーションとします。

前提条件

トピック・リス トに戻る

このチュートリアルを始める前に、次のことを実行しておく必要がありま す。

1.

Oracle JDeveloper 10gのインストール

このチュートリアルは、ビジネス分野における一般的なスキーマに基づいて いますが、データベース・リソースは不要です。

このアイコンの上にカーソルを置くと、すべてのスクリーンショットが表示されます。 各手順に関連するスクリーンショットのみを表示する場合は、それぞれの手順のアイコンの上にカーソルを置いてください。

注意: すべてのスクリーンショットを開くと、使 用しているインターネット接続によっては応答時間が遅くなる場合があります。

アプリケー ションワークスペースの新規作成

トピック・リス トに戻る

JDeveloperを使用して作業をする場合、アプリケーションワーク スペース内のプロジェクトに作業を組み立てます。 JDeveloperには事前定義済みテンプレートが多数用意されており、このテンプレートを使用してワークスペースやプロジェクトを作成し、構成して作 業対象のアプリケーションを開発します。 テンプレートは、アプリケーションに必要な基本的なテクノロジを提供します。 作業環境は、アプリケーションのタイプに適するテンプレートを選択し、必要な場合さらにテクノロジを追加して作成します。

ただし、このチュートリアルでは、「No Template」(テンプレートは使用しない)オプションを選択します。

 

1.

アプリケーション・ナビゲータで「アプリケーション」を右ク リックし、コンテキスト・メニューから「新規アプリケーション・ワークスペース」を選択します。

Move your mouse over this icon to see the image


2.

アプリケーション・ワークスペースの作成」ダイアログ ボックスで、アプリケーション名をApplication1か らProductOrderingに変更します。
(新しいアプリケーション名に対応してディレクトリ名も変更されることに注意してください。) アプリケーション・テンプレートとして、「No Template [All Technologies]」 を選択し、「OK」をクリックします。

Move your mouse over this icon to see the image

3.

ProductOrderingワー クスペースが作成され、ナビゲータにノードとして表示されます。 プロジェクトProjectがデフォルトで追加されます。 「す べて保存」ボタンをクリックし、作業内容を保存します。 このチュートリアルの残りの部分についても、作業内容を定期的に保存してください。

Move your mouse over this icon to see the image

 

 

ユースケース図の作成

トピック・リス トに戻る

この手順では、ユースケー ス図に対しActor、Communication、Use Case、Includeの4つのコンポーネントを使用します。
Actorは、システムと相互対話する外部ロールを表します。
Use Caseは、システムが外部アクターに対して実行する主要機能の説明です。 JDeveloperでは、Use Case - CasualまたはUse Case - Fully Dressedのいずれかを選択できます。 Use Case - Fully Dressedはより詳細な説明をサポートします。

1.

ナビゲータで「Project」ノードを右クリックして「新 規」を選択し、「新規ギャラリ」を表示します。

Move your mouse over this icon to see the image


2.

「新規ギャラリ」ウィンドウで「General」ノードを展開し、「Diagrams」 カテゴリを選択し、「UML Use Case Diagram」項目をダブルクリックします。

Move your mouse over this icon to see the image

3.

「UML Use Case Diagramの作成」ダイアログ ボックスの「名前」フィールドにWeb Orderingと入力し、「パッケージ」フィールドはデフォルトのままにし ます。 「OK」をクリックします。

Move your mouse over this icon to see the image

4.

空のWeb Orderingダイアグラムが表示されます。

Move your mouse over this icon to see the image

5.

コンポーネント・パレットが表示されていない場合、「表示」メニューからコ ンポーネント・パレット」を選択して表示します。

Move your mouse over this icon to see the image

6.

「コンポーネント・パレット」で「Actor」アイコンを選択し、図の左側をクリックします。 デフォルトのアクター名Actor1Customerに置き換えます。


Move your mouse over this icon to see the image

7.

Use Case - Casual」アイコンをクリックし、「コンポー ネント・パレット」でCustomerのシルエットの右にドラッグします。 ユースケースの名前をOrder Productsに 変更します。

Move your mouse over this icon to see the image

8.

Communication」アイコンをクリックし、 CustomerとOrder Productsの間に線を引きます。

Move your mouse over this icon to see the image


9.

Use Case - Fully Dressed」アイ コンをクリックし、 Order Productsの右側にドラッグします。 ユースケースの名前をBrowse Product Descriptionsに 変更します。

Move your mouse over this icon to see the image

10.

Use Case - Fully Dressed」アイ コンをクリックし、 Browse Product Descriptionsの下をクリックします。 名前をManage Shopping Cartに 変更します。

Move your mouse over this icon to see the image

 

11.

Use Case - Fully Dressed」アイ コンをクリックし、 Manage Shopping Cartの下をクリックします。 名前をProcess Orderに 変更します。

Move your mouse over this icon to see the image

 

12.

作成したユースケース図は次のような状態になります。

Move your mouse over this icon to see the image

 

13.

Order Productsユースケースには、他の3つの ユースケースが含まれているため、次の手順を実行します。

「コンポーネント・パレット」で「Inclusion」アイ コンを選択し、Order ProductsBrowse Product Descriptionsの間に線を引きます。

Move your mouse over this icon to see the image

 

14.

前述の手順を繰り返し、Orders ProductsManage Shopping Cartを含めます。

Move your mouse over this icon to see the image

 

15.

前述の手順を繰り返し、Orders ProductsProcess Orderを含めます。

Move your mouse over this icon to see the image

 

16.

ファイル」→「すべて保存」 を選択して作業内容を保存します。

Move your mouse over this icon to see the image

 

17.

作成したユースケース図は次のような状態になります。

Move your mouse over this icon to see the image

 

 

図のコンポーネントへの詳細の追加

トピック・リス トに戻る

この手順では、ユースケース図に描画したコンポーネントに詳 細を追加してコンポーネントの定義を完成し、ユースケースを明確にします。

 

顧 客定義への情報の追加
ユー スケースへの詳細の追加

 


顧客定義への情報の追加

リストに戻る

1.

Customer」アクターのシルエットをダブルクリック し、このアクターの定義を表示します。

Move your mouse over this icon to see the image

2.

Responsibilities」セクションのactor_responsibilitiesの 下の黒丸の横をクリックし、次のように入力します。

As the user has validated his order, he becomes a "de facto" customer.

Move your mouse over this icon to see the image

 

 

3.

Background and skills」セクション のactor_profileの下に、次のように入力します。

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.

Referenced By」セクションに、Order Productsへのリンクがあることに注意してください。 これは、「Communication」アイコンを使用して図上で線を追加した際に自動的に作成されたリンクです。

Move your mouse over this icon to see the image

 

 

ユースケースへの詳細の追加

リストに戻る

1.

editor」ウィンドウの最上部にある「Web Ordering」タブをクリックし、Web Orderingダイアグラムを表示します。

Move your mouse over this icon to see the image

 

2.

Order Products」をダブルクリックして、こ のユースケースを表示します。 これは、前述の手順で「Casual」アイコンを使用して作成したユースケースです。

Move your mouse over this icon to see the image

「エディタ」タブをクリックし、エディタ・ビューを開きます。

 

3.

Scenario」セクションで、他のユースケースへの参 照が含まれていることを確認します。 シナリオについての次の説明を、Browse Product Descriptionsへ の参照の上にカット&ペーストします。

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.

リンク「Browse Product Descriptions」 を選択し、do Xの横にドロップします。 プレースホルダのワードを削除します。

Move your mouse over this icon to see the image

 

5.

リンク「Manage Shopping Cart」を選択 し、do Yの 横にドロップします。 プレースホルダのワードを削除します。

Move your mouse over this icon to see the image

 

6.

リンク「Process Order」を選択し、do Zの 横にドロップします。. プレースホルダのワードを削除します。

Move your mouse over this icon to see the image

 

7.

作成したユースケースは次のような状態になります。

Move your mouse over this icon to see the image

 

8.

Web Ordering」タブをクリックし、エディタで ユースケース図を開きます。

Move your mouse over this icon to see the image

 

9.

Browse Product Definitions」 をダブルクリックし、このユースケースの定義を表示します。

Move your mouse over this icon to see the image

 

10.

前述のユースケースよりも、詳細なセクションが含まれていることに注目してください。 これは、このユースケースは「Fully dressed」アイコンを使用して作成されたためです。

Move your mouse over this icon to see the image

 

11.

Scenario」セクションで、メッセージ「<<< 次の要素をここに挿入」を選択し、削除します。エディタのツールバーにある「順序付けられていないリストアイコンをクリックし、番号付けを箇条書き リストに置き換えます。

Move your mouse over this icon to see the image

 

12.

Scenario」 セクションのusecase_includesの下に、ユースケースについての次の説明を追加します。

  • 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.

エディタ・ウィンドウの最上部にあるタブを使用してWeb Orderingダ イアグラムを表示します。

Move your mouse over this icon to see the image

 

14.

Manage Shopping Cart」をダブルク リックし、このユースケースの定義を表示します。

Move your mouse over this icon to see the image

 


15.

Scenario」セクションで、メッセージ「<<< 次の要素をここに挿入」を選択し、削除します。「順序付けられていないリストアイコンをクリックし、番号付けを箇条書き リストに置き換えます。 Scenario」セクションのusecase_includesの 下に、ユースケースについての次の説明を追加します。

  • 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.

エディタ・ウィンドウの最上部にあるタブを使用してWeb Orderingダ イアグラムを表示します。

Move your mouse over this icon to see the image

 

17.

Process Order」をダブルクリックし、この ユースケースの定義を表示します。

Move your mouse over this icon to see the image

 

18.

Scenario」セクションで、メッセージ「<<< 次の要素をここに挿入」を選択し、削除します。

Move your mouse over this icon to see the image

 

19.

次のアクションを追加します。

  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.

Precondition」セクションで、次の文章を追加 します。

Shopping cart is not empty
Provide username and password

Move your mouse over this icon to see the image

 

21.

Precondition」セクションの「Minimal Guarantee(s) :」に、次の文章を入力します。

Credit card information is valid

Move your mouse over this icon to see the image


22.

Precondition」セクションの「Success Guarantee(s) :」に、次の文章を入力します。

No products are ordered if the payment cannot be verified

Move your mouse over this icon to see the image

 

23.

Web Orderingダイアグラムを開きます。

Move your mouse over this icon to see the image

 

24.

ファイル」→「すべて保存」 を選択して作業内容を保存します。

Move your mouse over this icon to see the image

 

25.

Process Orderのテキストを選択し、Finalize Orderに変更します。

Move your mouse over this icon to see the image

 

26.

Order Products」をダブルクリックします。

Move your mouse over this icon to see the image

 

27.

「Scenario」セクションのリンク「Finalize Order」 が新しい名前になっていることに注意してください。

Move your mouse over this icon to see the image

 

28.

ファイル」→「すべて保存」 を選択して作業内容を保存します。

Move your mouse over this icon to see the image

 

 

ユースケース図の改良

トピック・リス トに戻る

次の手順では、「Generalization」アイコンお よび「Extension」アイコンを使用してユースケースを改良します。

 

1.

エディタでWeb Orderingダイアグラムを開きま す。

Move your mouse over this icon to see the image

 

2.

「コンポーネント・パレット」で「Actor」アイコンを選択し、図上にすでにあるCustomerア クターの下をクリックします。

Move your mouse over this icon to see the image

 

3.

新しいアクターActor1の名前をRegistered Customerに変 更します。

Move your mouse over this icon to see the image

 

4.

「コンポーネント・パレット」で「Generalization」 アイコンを選択し ます。

Move your mouse over this icon to see the image

 

5 .

ソースとしてRegistered Customerのシル エットをクリックし、ここからCustomerまでの間にGeneralizationを 作成します。 (ヒント: Generalizationの矢印はRegistered CustomerではなくCustomerを 指す必要があります。)

Move your mouse over this icon to see the image

 

6.

Registered Customer」シルエットをダ ブルクリックし、このアクターのプロパティを表示します。

Move your mouse over this icon to see the image

 

7.

次の文章を切り取り、「Background and skills」 セクションのactor_profile参照の下に貼り付けます。

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.

エディタでWeb Orderingダイアグラムを開きま す。

Move your mouse over this icon to see the image

 

9.

「コンポーネント・パレット」で「Use Case - Fully Dressed」アイコンを選択し、図中のFinalize Orderの下をクリックします。

Move your mouse over this icon to see the image

 

10 .

ユースケースの名前をUseCase1からFinalize Order For Registered Customerに変更します。

Move your mouse over this icon to see the image

 

11.

「コンポーネント・パレット」で「Communication」 アイコンを選択し ます。

Move your mouse over this icon to see the image

 

12.

ソースとしてRegistered Customerのシル エットをクリックし、ここからFinalize Order For Registered Customerまでの 間にCommunicationの線を引きます。

Move your mouse over this icon to see the image

 

13.

「コンポーネント・パレット」で「Extension」アイ コンを選択します。

Move your mouse over this icon to see the image

 

14.

Finalize Order For Registered Customerのシルエットをクリックし、ここからFinalize Orderまでの間にExtensionの 線を引きます。 (ヒント: Extension線の矢印は、Finalize Order For Registered CustomerではなくFinalize Orderを指す必要があります。)

Move your mouse over this icon to see the image

 

15.

Finalize Order For Registered Customer」をダブルクリックし、このユースケースのプロパティを表示します。

Move your mouse over this icon to see the image

 

16.

Precondition」セクションに次の文章を入力 し、ブロック・フォーマットを「Paragraph」に設定します。

Customer provides a valid Username and Password combination.

Move your mouse over this icon to see the image

17.

Scenario」セクションで、メッセージ<<< 次の要素をここに挿入を選択して削除し、次の文章を追加します。

  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.

エディタでWeb Orderingダイアグラムを開きま す。

Move your mouse over this icon to see the image

 

19.

Note」アイコンを選択し、図上でRegistered Customerの下をクリックします。

Move your mouse over this icon to see the image

 

20.

テキスト領域に、次の文章を入力します。

Username and password need to be valid.

Move your mouse over this icon to see the image

 

21.

「コンポーネント・パレット」で「Attachment」ア イコンを選択します。

Move your mouse over this icon to see the image

 

22.

テキスト領域からRegistered Customerに 線を引きます。

Move your mouse over this icon to see the image

 

23.

ファイル」→「すべて保存」 を選択して作業内容を保存します。

Move your mouse over this icon to see the image

 

24.

作成したユースケース図は次のような状態になります。

Move your mouse over this icon to see the image

 

 

ユースケース用のJavaDocの生成

トピック・リス トに戻る

次の手順では、ユースケース用のドキュメントを生成します。

 

ド キュメントの生成およびJDeveloperでの表示
ブ ラウザでのドキュメントの表示


ドキュメントの生成およびJDeveloperでの表 示

リストに戻る

 

1.

アプリケーション・ナビゲータで「Project」ノードを 選択します。.

Move your mouse over this icon to see the image

 

2.

メニューで「実行」→「Javadoc Project.jpr」を選択します。

Move your mouse over this icon to see the image

 

3.

表示」→「ログ」を選 択し「ログ」ウィンドウを開きます。

Move your mouse over this icon to see the image

 

4.

「ログ」ウィンドウで「Javadoc」タブを選択し、「ド キュメントの表示」ハイパーリンクをクリックします。

Move your mouse over this icon to see the image

 

5 .

エディタ・ウィンドウには、図の各コンポーネントについて生成されたナビゲーション・リンクがカ テゴリ別に表示されています。

Move your mouse over this icon to see the image

 

6.

各リンクをクリックすると、コンポーネントのすべてのプロパティが表示されます。

Move your mouse over this icon to see the image

 

7.

index.htmlというファイルが新しく生成され、アプリケーション・ナビゲータに表示され ていることを確認します。

Move your mouse over this icon to see the image

 

 


ブラウザでのユースケース・ドキュメントの表示

リストに戻る

次の手順を行うには、ブラウザをJDeveloper環境に プラグインとして追加する必要があります。 次に、ブラウザ・ツールとしてInternet Explorerを使用した例を示します。

1.

メニューで「ツール」→「外部ツール」 を選択し、ダイアログ ボックスで「追加」をクリックします。

Move your mouse over this icon to see the image

 

2.

「外部ツールの作成」ダイアログ・ボックスで、「プログラムの実行ファイル」 フィールドの横にある「参照」をクリックします。

Move your mouse over this icon to see the image

 

3.

ディレクトリ構造でブラウザの実行ファイルを検索し、「開く」 をクリックします。

Move your mouse over this icon to see the image

 

4.

引数」フィールドの横の「挿入」 をクリックします。

Move your mouse over this icon to see the image

 

5.

一覧から「ファイルURL」を選択し、「OK」 をクリックします。

Move your mouse over this icon to see the image

 

6.

実行ディレクトリ」フィールドの横の「参 照」ボタンをクリックします。

Move your mouse over this icon to see the image

 

7.

ディレクトリの選択」ダイアログ ボックスで、「{jdev_home}\jdev\mywork」 を選択し、「選択」をクリックします。

Move your mouse over this icon to see the image

 

8.

次へ」をクリックし、ウィザードの「ス テップ 2」を表示します。 このページでは変更を行いません。 「次へ」をクリックします。

Move your mouse over this icon to see the image

 

9. ウィザードの「ステップ 3」で 「ナビゲータ・ポップアップ・メニュー」を選択します。

Move your mouse over this icon to see the image

次へ」をクリックします。

 

10.

ウィザードの「ステップ 4」で「特 定のファイル・タイプが選択されている場合」オプションを選択します。

Move your mouse over this icon to see the image

 

11.

「使用可能なタイプ」一覧から「HTMLソース」および「XHTML ソース」を選択し、「移動」ボタンを使用して「選択されているタイプ」一覧に移動し「終了」 をクリックします。

Move your mouse over this icon to see the image

OK」をクリックし、ウィザードを終了します。

 

12.

アプリケーション・ナビゲータで「index.html」を 右クリックします。

Move your mouse over this icon to see the image

 

13.

コンテキスト・メニューに、「Internet Explorer」 が新しいオプションとして追加されました。 このオプションを選択します。

Move your mouse over this icon to see the image

 

14.

ブラウザが開きます。ページの左側のフレームにあるリンクを使用し、ユースケース・ドキュメント を参照できます。

Move your mouse over this icon to see the image

 

 

ト ピック・リストに戻る

このチュートリアルでは、次のことを学びました。

アプリケーションワークスペースの新規作成
ユー スケース図の作成
図の コンポーネントへの詳細の追加
ユー スケース図の改良
ユー スケース用のJavaDocの生成

 

 

このアイコンの上にカーソルを置くと、すべてのスクリーンショットが非表示になります。