Analysis Phase分析階段
在軟件工程,分析是一種過程,把用戶需求轉變為系統需求
系統規格說明,也稱為邏輯結構,是開發人員眼中的系統
已經有了哪些業務規則、業務邏輯?
還有哪些事需要提醒客戶的?
大的、復雜系統的開發,有兩種主要的分析方法
面向功能的分析Function-oriented analysis
concentrating on the decomposition of complex functions to simply ones.
面向對象分析Object-oriented analysis
identifying objects and the relationship between objects.
在抽象層面,面向功能的分析法用得多一點
把系統分成模塊
在模塊層面,面向對象分析法用得多一點
模塊的功能如何實現?--- OOAD技術!
從“用戶的角度”到“開發人員的角度”之間的差異
Object Oriented Analysis 面向對象分析主要步驟
Identifying objects 識別對象
Organising the objects: 組織對象
classifying the objects identified, so similar objects can later be defined in the same class.
Identifying relationships between objects: 定義對象之間的關系
this helps to determine inputs and outputs of an object.
Defining operations of the objects: 定義對象的操作
the way of processing data within an object.
Also known as ‘responsibility assignment’
這一步,主要在設計階段完成
Defining objects internally: 定義對象內部細節
information held within the objects.
Three ways to do Object Oriented Analysis (there are more…)
1)Conceptual model (Larman) 概念模型,又稱“名詞法”
Produce a “light” class diagram
2)Analysis model with stereotypes (Jacobson) 分析模型
Boundaries, entities, control.
3)CRC cards (Beck, Cunningham) CRC法,類/職責/協作
Index cards and role playing.
A good analyst knows more than one strategy and even may mix strategies in order to identify the objects and relationships for the design phase.
一個好的分析師掌握多種技術,知道如何混合使用各種技術。目標只有一個: 發現對象、定義對象之間的關系。
概念模型
概念模型 conceptual model 表示了問題領域的的 “概念”及其關系,也稱 為領域模型 ‘domain model’
UML圖形表示為 “沒有定義操作的類圖”
它能夠顯示:概念 Concepts、概念之間的關系 Associations of concepts、概念的屬性 Attributes of concepts
名詞法定義概念類
名詞法定義概念(conceptual class)
重用或者修改已有的模型 Reuse or modify existing models.
This is the first, best, and usually easiest approach
借助行業、公司內部法的“概念類列表 ” Concept Category List
在需求描述中查尋名詞(短語)Finding Concepts with Noun Phrase Identification.
復習: 面向對象分析與結構化分析方法之間的最大差異是 A central distinction between object oriented and structures analysis:
前者根據對象划分系統,而后者根據功能 division by concepts (objects) rather than division by functions.
概念類列表 The Concept Category List Table
Finding Concepts with Noun Phrase Identification 名詞短語法
方法
在問題領域的文本描述中,標識出名詞、名詞短語,把它們作為候選的概念類或者屬性 Identify the noun and noun phrases in textual descriptions of a problem domain and consider them as candidate concepts or attributes
對發現的名稱(短語)進行分析,辨別是合適的概念類嗎?概念可以合並嗎?等等
定義概念類之間的關系
定義概念類的屬性
注意
不能機械地轉換“名稱 ----> 概念類”
自然語言描述的文字有歧義、重復、一詞多意、一意多詞等,要仔細分析
比如英語,復數一般就不需要了,students\student, 只要student即可
小結
領域(用戶的角度)、系統(開發人員的角度)
概念模型 == 領域模型 概念類 == 領域概念
如何尋找、定義領域內的概念類?
方法一:名稱法
利用已有
查找概念類列表
從問題描述中尋找名詞、名詞短語,進行分析
方法二:分析模型法
方法三:CRC法