Key Terms Object Message flow Basic Interaction diagram

Key Terms ª Object ª Message flow Basic ª Interaction diagram © Procedure call flow of control © Asynchronous flow of control © Flat flow of control call © Return flow a procedure call ª Message © Label © Condition © Creation © Destroy Interaction Diagram © Collaboration diagram • Link • Active object © Sequence diagram • • Lifeline Focus of control Branching Message with transaction time 東吳大學資訊科學系 江清水



Notation and Semantics Interaction diagram: Collaboration diagram (Modeling Flows of Control by Organization) :描述為達 c: Client 1: <<create>> 2: set. Action(a, d, o) 3: <<destroy>> <<local>> <<global>> : Transaction p: ODBCProxy {transient} 2. 1: set. Values(d, 3. 4) 2. 2: set. Values(a, ”CO”) object 1 object 2 [condiction 1] Message 1 [condiction 2] Message 2 成一個特定動作所有關連的Object, 及Object互相合作的關係與訊息傳 遞順序。 Sequence diagram (Modeling Flows of Control by Time) :根據時間發生順序 來表達物件間的互動及一連串時序 上的訊息傳遞,起始觸發可以是由 事件 (Event) 、行動者(Actor)、物 件(Object)觸發。 Interaction Diagram 東吳大學資訊科學系 江清水

Example(Collaboration Diagram) : Phone : Sound Alarm : System Handler : Sound Alarm 2 b: Trigger 2 a: Trigger 2 c. 2: Trigger : Supervisor 2 c: Alarm : Cell Handler : Log 2 c. 1: Store(Date, Time, Cell, Sensor) 1: Alarm : Photo Cell Sensor Active Object、Predecessor Interaction Diagram 東吳大學資訊科學系 江清水

Collaboration Diagram 2. 2:put. Recent. Pick(loc) 2: click. At(p) c: Caller : Telephone : Exchange Procedural Sequence 2. 1: loc=find. At(p) 1: lift. Handset() c: Caller : Telephone 2: assert. Call : Exchange Flat Sequence Interaction Diagram 東吳大學資訊科學系 江清水
![Example(Collaboration Diagram) 5: kill checkers <<self>> 1: new [Valid] a Transaction Coordinator a Transaction Example(Collaboration Diagram) 5: kill checkers <<self>> 1: new [Valid] a Transaction Coordinator a Transaction](http://slidetodoc.com/presentation_image_h2/6b62c6885818315c5a2bf5181ab35576/image-7.jpg)
Example(Collaboration Diagram) 5: kill checkers <<self>> 1: new [Valid] a Transaction Coordinator a Transaction 7: be Invalid 4: fail 3: new 6: kill 2: new a first Transaction Checker Interaction Diagram a second Transaction Checker 東吳大學資訊科學系 江清水

Example(Sequence Diagram) 當一個Transaction產生之後 …. . a Transaction …它會產生一個Coordinator 來管理所有的檢查 1: new a Transaction Coorinator 2: new Coordinator會為每一種檢查 產生一個Checker。這些 Checker會各自進行自己的檢 查 a first Transaction Checker a second Transaction Checker 3: new 4: fail 如果某一個檢查失敗, Coordinator就會把其他還在 執行的Checker刪除 5: kill checkers X 6: kill …. 並且告訴Transaction說 檢查失敗 7: be. Invalid X X Object、Lifeline、Activation 、 Synchronous 、 Asynchronous 、 Return、Simple、Iteration、Label、Creation、Destroy Interaction Diagram 東吳大學資訊科學系 江清水

Example(Sequence Diagram) c: Client <<create>> object {transient} p: ODBCProxy : Transaction set. Actions(a, d, o) set. Values(d, 3. 4) time set. Values(a, ”CO”) committed <<destroy>> Interaction Diagram X 東吳大學資訊科學系 江清水

Notation and Semantics Collaboration diagram • Link (連結): 連接兩物件的線。 active. Object: Active. Class • Active Object (主動物件): 主動物件 是擁有控制線(Thread)以及啟始控制動 作(Control Operation)的物件。 1. 1: get. Last. Checkpoint() 1: get. Postion. At. Time(t) t: Air. Traffic. Planner Interaction Diagram p: Flight. Plan 東吳大學資訊科學系 江清水

![Notation and Semantics object 2 object 1 [condiction 1] Message 1 [condiction 2] Message Notation and Semantics object 2 object 1 [condiction 1] Message 1 [condiction 2] Message](http://slidetodoc.com/presentation_image_h2/6b62c6885818315c5a2bf5181ab35576/image-12.jpg)
Notation and Semantics object 2 object 1 [condiction 1] Message 1 [condiction 2] Message 2 object 1 b {b’-b<1 sec} b’ object 2 Message Interaction Diagram • Branching(分支): 表示當在多 種條件下,所可能產生的訊息。 各種條件為互斥。 • Message with transaction time: 表示message傳送的時間限 制(由b到b‘) 。 東吳大學資訊科學系 江清水

Example(Sequence Diagram) Print(file) : Computer : Printer. Server Print(file) : Printer : Queue [printer free] Print(file) [printer busy] Store(file) Condition、Branching Interaction Diagram 東吳大學資訊科學系 江清水

Review(Collaboration Diagram) servers client : Server 1: a. Server: =find(specs) a. Server{local} : Server 2: process(request) Multiobject、Simple Message Interaction Diagram 東吳大學資訊科學系 江清水

Review(Collaboration Diagram) Object Message Caller 1: Off. Hook 2: Dial. Tone 3: Dial. Number Exchange 4: Ring. Tone Receiver 6: On. Hook 5: Off. Hook Talk Telephone Call Interaction Diagram 東吳大學資訊科學系 江清水
![Review(Collaboration Diagram) New. Customer() 1: [free memory]Create() : Main Window 3: Show(Customer) : Customer{new} Review(Collaboration Diagram) New. Customer() 1: [free memory]Create() : Main Window 3: Show(Customer) : Customer{new}](http://slidetodoc.com/presentation_image_h2/6b62c6885818315c5a2bf5181ab35576/image-16.jpg)
Review(Collaboration Diagram) New. Customer() 1: [free memory]Create() : Main Window 3: Show(Customer) : Customer{new} 2: Create() 3. 1 Update{data} : Customer Window Creation of Object、 Synchronous Interaction Diagram 東吳大學資訊科學系 江清水

Review(Collaboration Diagram) c: Client 1: <<create>> 2: set. Action(a, d, o) 3: <<destroy>> <<local>> : Transaction <<global>> p: ODBCProxy {transient} 2. 1: set. Values(d, 3. 4) 2. 2: set. Values(a, ”CO”) Interaction Diagram 東吳大學資訊科學系 江清水

Review(Collaboration Diagram) 2: add. Student(s) r: Registrar. Agent 1: <<create>> : School 3. 1: get. Schedule 2: register() <<local>> s: Student Registered = False Registered = True 3. 4: <<become>> 3. 2: add(s) 3. 3: add(s) c 1: Course {association} Interaction Diagram c 2: Course {association} 東吳大學資訊科學系 江清水

Review(Sequence Diagram) c: Client p: Planning. Assistant <<create>> : Ticket. Agent Setltinerary(i) calculate. Route() route <<destroy>> X notify() Messages Interaction Diagram 東吳大學資訊科學系 江清水

Review(Sequence Diagram) c: Client : Switch R: Caller life. Receiver set. Dial. Tone() dial. Digit(d) {dialing. execution. Time < 30 sec} route. Call(s, n) <<create>> Connect(r) c: Conversation Connect(r, s) Ring() life. Receiver Connect(s) Callers s and r may exchange information after both are connected Interaction Diagram 東吳大學資訊科學系 江清水

Key Terms Advance ª Interaction diagram © Collaboration diagram • Path stereotypes – – Self Global local parameter © Sequence diagram Interaction Diagram 東吳大學資訊科學系 江清水
- Slides: 21