顯示具有 UML 標籤的文章。 顯示所有文章
顯示具有 UML 標籤的文章。 顯示所有文章

2009年5月3日 星期日

What is State Diagram? (1)

狀態圖主要用來說明某一物件(Object)可能轉換的各種狀態,而一物件其狀態改變通常是因為某一事件(event)的發生迫使物件改變其狀態。

利用轉換標籤(Transition Label)來代表狀態與狀態間的轉換。其轉換標籤的格式為Event(Guard)/Action. Event代表觸發此轉換的事件內容,Guard代表需要符合的條件,若條件不合就不能進行狀態轉換。Action代表在轉換過程當中需要執行的事項。在執行Action時,Action執行過程是不可以被打斷的,也就是說必須執行完整的Action後,才可讓系統轉換去執行其他處理程序。


2009年5月2日 星期六

Generalization Relationship in Use Case


就是類別當中一般化與特殊化的概念。以前常念到的動物是一般化的類別,而鳥是特殊化的類別(相對於類別”動物”)。對應到use case當中,參照圖中的例子,相對於generalized use case “Drive Vehicle”來說use case “Drive motorcycle”與”Drive Ambulance”僅為其特例(specialized use case)而已。

Include and extend relationships in Use Case


圖中可以了解到included use case-“supply customer data”, “order product” and “Arrange payment”-base use case ”Place order”的一部分(想成是一部分功能)。因為included use case有可能或常常被其他use case使用,所以獨立成一個use case,當作是一個基本元件,以便重複使用。

extension use case “Request Catalog”主要用來擴充base use case的步驟,可想成是額外增加的功能。一旦有額外的需求發生,如例子中salesperson要求要商品目錄時,這額外的功能就需要去執行。當然在base use case中的extension points 有說到此額外功能要在訂單開出後,salesperson提出此額外擴充的步驟才會需要執行。

What is Use Case?

What is Scenario?

A scenario is a sequence of steps describing the interaction between a user and a system. So if we have web-based on-line store, we might have a Buy a Product scenario that would be documented as a story. Based on the story the steps for the scenario can be extracted.


What is Use Case?

A simple format for capturing a user case involves describing its primary scenario as a sequence of steps and the alternatives as variations on that sequence.

 

What is Actor?

l   An actor is a role that a user plays with respect to the system.

l   A single actor may perform many use cases; conversely, a user case may have several actors performing it.

l   It is easier to arrive at the list of actors first, and then try to work out the use cases for each actor.

l   Actors don’t need to be human. An actor can also be an external system that needs some information from the current system.

 

Use Case relationships in UML?

l   Include relationship: Use include when you are repeating yourself in two or more separate use cases and you want to avoid repetition. (如果你在兩個以上的使用案例(use cases)中重複一些行為,可是又不願意重複這個行為時,可以使用包含(Include)關係。)

l   Use Case generalization: Use generalization when you are describing a variation on normal behavior and you wish to describe it casually. A given use case may be a specialized form of an existing use case. The notation is a solid line ending in a hollow triangle drawn from the specialized to the more general use case. This resembles the object-oriented concept of sub-classing.(特殊化使用案例(specificalized use case)則可能改寫或新增步驟)

l   Extend relationship: Use extend when you are describing a variation on normal behavior and you wish to use the more “controlled form”, declaring your extension points in your base use case. (擴充使用案例(extension use case)是在基本使用案例(base use case)的情節中,新增步驟)