[系分] Domain Model

一組沒有定義操作(方法的特徵標記)的類圖,也稱爲概念類圖

步驟:(1)尋找概念類

概念類:思想,事物或對象(也就是說找名詞


描述類:描述其他事物的信息,如FlightAirport之間最好添加一個FlightDescription這個描述類。

2)將其繪製爲UML類圖的類

3)添加關聯和屬性

關聯:名稱需要首字母大寫,一般以類名-動詞短語-類名的格式來命名。但在領域模型中,避免加入太多關聯,是否需要記錄關聯,要基於現實世界的需要,就是那些“需要記住”的關聯關係。

多重性:類A有多少個實例可以和類B的一個實例關聯

 

屬性:對象的邏輯數據值。當需求(用例)建議或暗示需要記住信息時,引入屬性

(可以只有屬性名稱,不需要類型,可見性)

注意:通常不超過10個概念類,至少有一個描述類,一個類只能有兩層 

belong to, contain,desc to等


例1 Priests and Devils

案例描述:Priests andDevils is a puzzle game in which you will help the Priests and Devils to cross theriver within the time limit. There are 3 priests and 3 devils at one side of the river. They all want to get to the other side of this river, but there is only oneboat and this boat can only carry two persons each time. And there must be one person steering the boat from one side to the other side. In the flash game, you can click on them to move them and click the go button to move the boat to the other direction. If the priests are out numbered by the devils on either side of the river, they get killed and the game is over. You can try it in many ways. Keep all priests alive! Good luck! 

關於玩法和遊戲規則一般不用描述

 


例2   POS,酒店預定等案例

  

例3:背單詞

Develop a domain model of the application(注意:僅需要從設置學習內容,背單詞用例中獲取領域對象). The model should take business perspectives. The conceptual model should show attributes in classes and relationships between classes. All associations should have multiplicities carefully defined. There is no need to specify attribute types and operations (methods).

   






發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章