邋遢居

          我的Java天堂

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            61 Posts :: 2 Stories :: 90 Comments :: 0 Trackbacks
          OOD實例閱讀筆記(二)
          Use case 圖包括的內(nèi)容

          Use case圖是用于需求分析的工具。他和實現(xiàn)技術沒有任何關聯(lián)。他的目的寫出特定情況下的需求。

          首先就是要有一定的場景。場景包括特定的環(huán)境(case 發(fā)生的條件),參與的人(action)和系統(tǒng)所做的響應。

          一般情況下回采用黑箱的use caseblak – box use case)。黑箱的use case不關心具體的實現(xiàn)。只是確定系統(tǒng)的責任。

          下面就提供一個use case的描述。


          USE CASE 5

          Buy Goods

          Goal in Context

          Buyer issues request directly to our company, expects goods shipped and to be billed.

          Scope & Level

          Company, Summary

          Preconditions

          We know Buyer, their address, etc.

          Success End Condition

          Buyer has goods, we have money for the goods.

          Failed End Condition

          We have not sent the goods, Buyer has not spent the money.

          Primary,

          Secondary Actors

          Buyer, any agent (or computer) acting for the customer.

          Credit card company, bank, shipping service

          Trigger

          purchase request comes in.

          DESCRIPTION

          Step

          Action

           

          1

          Buyer calls in with a purchase request

           

          2

          Company captures buyer’s name, address, requested goods, etc.

           

          3

          Company gives buyer information on goods, prices, delivery dates, etc.

           

          4

          Buyer signs for order.

           

          5

          Company creates order, ships order to buyer.

           

          6

          Company ships invoice to buyer.

           

          7

          Buyers pays invoice.

          EXTENSIONS

          Step

          Branching Action

           

          3a

          Company is out of one of the ordered items:

                 3a1. Renegotiate order.

           

          4a

          Buyer pays directly with credit card:

                 4a1. Take payment by credit card (use case 44)

           

          7a

          Buyer returns goods:

                 7a. Handle returned goods (use case 105)

          SUB-VARIATIONS

           

          Branching Action

           

          1

          Buyer may use

                 phone in,

                 fax in,

                 use web order form,

                 electronic interchange

           

          7

          Buyer may pay by

                 cash or money order

                 check

                 credit card

           


          RELATED INFORMATION

          5. Buy Goods

          Priority:

          top

          Performance

          5 minutes for order, 45 days until paid

          Frequency

          200/day

          Channel to actors

          not yet determined

          OPEN ISSUES

          What if we have part of the order?

          What is credit card is stolen?

          Due Date

          release 1.0

          ...any other

          management

          information...

           

          Superordinates

          Manage customer relationship (use case 2)

          Subordinates

          Create order (use case 15)

          Take payment by credit card (use case 44)

          這個例子是http://alistair.cockburn.us/usecases/usecases.html 中的template的一個很整是的例子。

          下面我在舉一個修改密碼的case.

          Change Password

          case在用戶選這修改密碼是觸發(fā)。Check輸入的兩個密碼是否相同。Check當前用戶然后更新數(shù)據(jù)庫。

          Purpose

          允許用戶修改自己的密碼。

          Overview

          這個case是為了給用戶提供修改密碼的可能。用戶可以通過點擊“Change My Pasword”菜單項來觸發(fā)。系統(tǒng)會彈出一個對話框供用戶輸入他的新密碼。用戶可以按“OK”或“Cancel”來選擇保存或放棄修改。系統(tǒng)這時會檢驗用戶輸入的信息是否正確。如果用戶輸入正確,保存用戶信息,返回主窗體。否則給用戶重來的機會。

          Typical Course of Events

          Line

          Actor Action

          System Response

          1

          用戶點擊”Chang My Password”菜單項。

           

          2

           

          系統(tǒng)顯示一個可以讓用戶輸入新密碼和Comfirm的對話框。

          3

          用戶輸入信息并點擊”O(jiān)K”按鈕.

           

          4

           

          系統(tǒng)Check輸入的信息。

          5

           

          把用戶輸入的信息更新到數(shù)據(jù)庫。

          6

           

          關閉對話框。顯示修改成功或失敗的提示信息。結束當前case.

          Alternative courses

          3

          用戶不點”O(jiān)K”而點擊”Cancel”。關閉對話框,結束該case.

          4

          系統(tǒng)監(jiān)測到下列三種情況的一個:(1)舊的密碼不正確。(2)兩次輸入的新密碼不相同。(3)新密碼格式不正確。系統(tǒng)顯示一個錯誤信息。清除當前對話框中的內(nèi)容。允許用戶重試。返回到第3步。

          5

          系統(tǒng)保存出錯。顯示錯誤信息。結束當前case.



          posted on 2006-01-10 19:11 Jet Geng 閱讀(1125) 評論(0)  編輯  收藏 所屬分類: OOD-OOA

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 上饶县| 荆州市| 广州市| 福建省| 宣汉县| 定日县| 泸州市| 盱眙县| 罗江县| 泰兴市| 卓资县| 大关县| 武城县| 娄烦县| 融水| 淄博市| 梨树县| 临沧市| 陵川县| 武宁县| 新宾| 九江市| 仪陇县| 区。| 沙坪坝区| 中西区| 大港区| 呼和浩特市| 百色市| 个旧市| 普定县| 古丈县| 湘潭市| 奉贤区| 嘉兴市| 隆德县| 思茅市| 休宁县| 土默特左旗| 白水县| 阿城市|