要做好一個系統分析師,不光是單純把使用需求給A完就算了,事實上有更多潛在的問題是等著被你挖掘出來盡早預防處理的!!
當面對不同變更的需求時,我們常常僅僅只是針對新需求項目添增field,以及其各項biz methods,而忽略所新增之需求是否有可能不是原本物件中所需要負責的"責任任務",更精進的作法應該是仔細檢視其物件的面向責任為何,然後加以拆解至不同的class.
上述的方式其實也可稱為是一種delegation的做法,把新增的項目包成一個外部的物件,使其與原始其他需求獨立出來..而這樣的處理方式正是loose coupling的力量所在
(盡可能將各物件之間鬆綁..不要有彼此依存的關係太過嚴重,簡單講就是當你要修改一個物件時,部會一拖拉庫的去改變了更多的物件)
# Delegation shields your objects from implementation changes to other objects in your software.
#在Class Diagram中, 若有以下此範例,表示不定長度之陣列
ex: getAllowedBarks(): Bark[*]
#Looking at the nouns(名詞), and verbs in your use case to figure out classes and methods is called textual analysis.
在這裡,我們可以將名詞的部分轉化為一個class,而將動詞部分設計為一個method來做為處理biz logic的作業,並將不同的名詞之間提供一個作用的關聯~by having the object.
# A good use case clearly and accurately explains what a system does, in language that's easily understood.
# With a good use case complete, textual analysis is a quick and easy way to figure out the classes in your system.(文件化的分析作法可以幫助我們聚焦在正確的事務上,而非單純只是創建classes)
# The verbs in your use cases are ( usually ) the methods of the objects in your system.
綜合了上述幾點資訊可以知道,我們將名詞轉化為class,但不要將external object 給轉進來..主要原因如下:
1. external object 是不需要知道我們系統內部到底如何運作的
2. external object 通常是短暫性的與系統交互作用,除非我們需要將外部的資訊儲存
3. 即使我們設計了external object 也對我們的系統沒有幫助,因為該物件上的行為不是我們可以控制
以下是本章節中,瑪麗亞設計的最漂亮的class diagram
UML 入門圖解集---
1. 實線
A solid line from one class to another is called an association.
It means that one class is associated with another class , by ref,extension,inheritance..etc
以下圖例說明note資訊
tc 1
SourceClass ------------------------------------> TargetClass
此例表示在SourceClass中有含有一個TargetClass的attribute
Bullet Points
# A good use case precisely lays out what a system does, but does not indicate how the system accomplished that task.
# Each use case should focus on only one customer goal. If you have multiple goals, you will need to write multiple use cases.
# The attribute in a class diagram usually map to the member variables of your classes.
# The operation in a class diagram usually represent the methods of your classes.
# Textual analysis helps you translate a use case into code-level classes , attributes, and operations.
# The nouns of a use case are candidates for classes in your system, and the verbs are candidates for methods on your system's classes.
沒有留言:
張貼留言