Sequence and Collaboration Diagram. Interaction Diagram models describe how groups of objects collaborate in some behavior models describe how groups.

Slides:



Advertisements
Similar presentations
FCU, Department of ECE, IC Design Research Lab. TEL: # 4945 Pre-SIm , Post-Sim.
Advertisements

Software Engineering for Digital Home 單元 2 :軟體處理程序與需求分析 2-3 需求工程處理程序 Presenter: Away.
Divide-and-Conquer. 什麼是 divide-and-conquer ? Divide 就是把問題分割 Conquer 則是把答案結合起來.
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
建立使用案例敘述 --Use Case Narrative
第 10 章 Java 的執行緒 10-1 執行緒的基礎 10-2 Java 執行緒的使用方法 10-3 Java 執行緒的同步 10-4 管道串流的執行緒.
: A-Sequence 星級 : ★★☆☆☆ 題組: Online-judge.uva.es PROBLEM SET Volume CIX 題號: Problem D : A-Sequence 解題者:薛祖淵 解題日期: 2006 年 2 月 21 日 題意:一開始先輸入一個.
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
Teacher : Ing-Jer Huang TA : Chien-Hung Chen 2015/6/2 Course Embedded Systems : Principles and Implementations Weekly Preview Question CH 1.4~CH /10/03.
Event Sampling 事件取樣法. 關心重點為「事件」本身明確的焦點 行為 清楚掌握主題 - 當「事件」出現時才開 始記錄 記錄程序 等待目標事件的發生 開始記錄 事件結束,停止記錄.
3Com Switch 4500 切VLAN教學.
期末專題 - 吊人頭遊戲 第 35 組 組員 : 電機系 49841XXXX XXX 電機系 49841OOOO OOO.
What is static?. Static? 靜態 ? class Test { static int staticX; int instanceX; public Test(int var1, int var2) { this.staticX = var1; this.instanceX =
自由進入及離開. 定義  長期 ─ 是指生產者能夠改變所有生產因素的情況。  自由進入及離開 ─ 是指公司能夠自由進入及離開市場而不受限 制。
Graph V(G 1 )={0, 1, 2, 3, 4, 5, 6, 7, 8, 9} E(G 1 )={(0, 2), (0, 3), (1, 4), (2, 3), (2, 5), (2, 6), (3, 6), (3, 7), (4, 7), (5, 6), (5,
JAVA 程式設計與資料結構 第十四章 Linked List. Introduction Linked List 的結構就是將物件排成一列, 有點像是 Array ,但是我們卻無法直接經 由 index 得到其中的物件 在 Linked List 中,每一個點我們稱之為 node ,第一個 node.
MS-DOS 作業系統 張基昇 (Microsoft-Disk Operating System).
Department of Air-conditioning and Refrigeration Engineering/ National Taipei University of Technology 模糊控制設計使用 MATLAB 李達生.
JAVA 程式設計與資料結構 第十章 GUI Introdution III. File Chooser  File Chooser 是一個選擇檔案的圖形介面, 無論我們是要存檔還是要開啟檔案,使 用這個物件都會讓我們覺得容易且舒適。
Chapter 13 塑模靜態觀點:物件圖 Static View : Object Diagram.
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
:Problem D: Bit-wise Sequence ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10232: Problem D: Bit-wise Sequence 解題者:李濟宇 解題日期: 2006 年 4 月 16.
24-6 設定開始與結束場景中的 程式 最後我們要替這個遊戲收個尾, 幫它把開始 的等待畫面跟結束畫面處理一下。
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
最新計算機概論 第 5 章 系統程式. 5-1 系統程式的類型 作業系統 (OS) : 介於電腦硬體與 應用軟體之間的 程式,除了提供 執行應用軟體的 環境,還負責分 配系統資源。
3-3 使用幾何繪圖工具 Flash 的幾何繪圖工具包括線段工具 (Line Tool) 、橢圓形工具 (Oval Tool) 、多邊星形 工具 (Rectangle Tool) 3 種。這些工具畫出 來的幾何圖形包括了筆畫線條和填色區域, 將它們適當地組合加上有技巧地變形與配 色, 不但比鉛筆工具簡單,
Matlab Assignment Due Assignment 兩個 matlab 程式 : Eigenface : Eigenvector 和 eigenvalue 的應用. Fractal : Affine transform( rotation, translation,
Chapter 20 塑模動態觀點:狀態圖 Statechart Diagram. 學習目標  說明狀態圖的目的  定義狀態圖的基本記號  展示狀態圖的建構  定義活動、內部事件及遞延事件的狀態 圖記號.
: Little Red Riding Hood ★★★☆☆ 題組: Contest Volumes Archive with Online Judge 題號: 11067: Little Red Riding Hood 解題者:陳明凱 解題日期: 2008 年 3 月 14 日 題意:
: Problem A : MiniMice ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11411: Problem A : MiniMice 解題者:李重儀 解題日期: 2008 年 9 月 3 日 題意:簡單的說,題目中每一隻老鼠有一個編號.
資料庫程式設計與系統管理 SQL Server 2005 Express 第六章 進階資料庫設計.
: Ahoy, Pirates! ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11402: Ahoy, Pirates! 解題者:李重儀 解題日期: 2008 年 8 月 26 日 題意:有一個海盜島有 N 個海盜,他們的編號 (id)
: Count DePrimes ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11408: Count DePrimes 解題者:李育賢 解題日期: 2008 年 9 月 2 日 題意: 題目會給你二個數字 a,b( 2 ≦ a ≦ 5,000,000,a.
短缺,盈餘與均衡. 遊戲規則  老師想出售一些學生喜歡的小食。  老師首先講出價錢,有興趣買的請舉手。
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
公司加入市場的決定. 定義  平均成本 = 總成本 ÷ 生產數量 = 每一單位產量所耗的成本  平均固定成本 = 總固定成本 ÷ 生產數量  平均變動成本 = 總變動成本 ÷ 生產數量.
卡內基訓練  Copyright, 1997 © Dale Carnegie & Associates, Inc. 1 簡報標題 TIP 如需進一步建議, 請看卡內基訓練  的簡報技巧.
資料結構實習-一 參數傳遞.
6-2 認識元件庫與內建元件庫 Flash 的元件庫分兩種, 一種是每個動畫專 屬的元件庫 (Library) ;另一種則是內建元 件庫 (Common Libraries), 兩者皆可透過 『視窗』功能表來開啟, 以下即為您說明。
著作權所有 © 旗標出版股份有限公司 第 21 章 文件的權限及保護 功能設定. 本章提要 設定文件讀取權限 保護文件.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2008.
公用品.  該物品的數量不會因一人的消費而受到 影響,它可以同時地被多人享用。 角色分配  兩位同學當我的助手,負責:  其餘各人是投資者,每人擁有 $100 , 可以投資在兩種資產上。  記錄  計算  協助同學討論.
: Beautiful Numbers ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11472: Beautiful Numbers 解題者:邱經達 解題日期: 2011 年 5 月 5 日 題意: 若一個 N 進位的數用到該.
JAVA 程式設計與資料結構 第二十章 Searching. Sequential Searching Sequential Searching 是最簡單的一種搜尋法,此演 算法可應用在 Array 或是 Linked List 此等資料結構。 Sequential Searching 的 worst-case.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
Chapter 3 Entropy : An Additional Balance Equation
逆向選擇和市場失調. 定義  資料不對稱 在交易其中,其中一方較對方有多些資料。  逆向選擇 出現在這個情況下,就是當買賣雙方隨意在 市場上交易,與比較主動交易者作交易為佳 。
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
Learning Method in Multilingual Speech Recognition Author : Hui Lin, Li Deng, Jasha Droppo Professor: 陳嘉平 Reporter: 許峰閤.
Chapter 10 m-way 搜尋樹與B-Tree
概念性產品企劃書 呂學儒 李政翰.
Probability Distribution 機率分配 汪群超 12/12. 目的:產生具均等分配的數值 (Data) ,並以 『直方圖』的功能計算出數值在不同範圍內出現 的頻率,及繪製數值的分配圖,以反應出該 機率分配的特性。
無線通訊網路 Mac 層 TDM 通訊模式的操作與效能研究 專題生 : 林書弘、蔡逸祥、毛建翔、王政 華 指導教授 : 黃依賢.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2009.
著作權所有 © 旗標出版股份有限公司 第 3 章 資料庫物件的關係. 本章提要 Access 資料庫物件的關係 Access 資料庫物件的關係 簡介 Access 的七大物件 簡介 Access 的七大物件 Access 的群組 Access 的群組.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 壹 企業研究導論.
:Commandos ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11463: Commandos 解題者:李重儀 解題日期: 2008 年 8 月 11 日 題意: 題目會給你一個敵營區內總共的建築物數,以及建築物 之間可以互通的路有哪些,並給你起點的建築物和終點.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 參 資料蒐集的方法.
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
Microsoft Excel.
多媒體技術與應用 實習作業 Part II. 實習作業 利用 Corel Paint Shop Pro X2 完成作業。 作業一:利用影像處理的技巧,讓這張影像變 的更清晰。
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
第12章 團體溝通情境中的領導者.
著作權所有 © 旗標出版股份有限公司 第 14 章 製作信封、標籤. 本章提要 製作單一信封 製作單一郵寄標籤.
幼兒行為觀察與記錄 第八章 事件取樣法.
VHDL語法(3).
1 柱體與錐體 1. 找出柱體與錐體的規則 2. 柱體的命名與特性 3. 柱體的展開圖 4. 錐體的命名與特性 5. 錐體的展開圖
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Presentation transcript:

Sequence and Collaboration Diagram

Interaction Diagram models describe how groups of objects collaborate in some behavior models describe how groups of objects collaborate in some behavior NOTE THAT: not class NOTE THAT: not class typically, captures the behavior of a single use case typically, captures the behavior of a single use case Two kinds Two kinds sequence diagrams sequence diagrams collaboration diagrams collaboration diagrams

an Order Entry window an Order Line a Stock Item a Reorder item a Delivery Item prepare() *prepare() hasStock:= check() [hasStock] remove() needsReorder:= needsToReorder() [needsReorder]new return [hasStock]new Creation return condition self call iteration message object deletion

When to use sequence diagram One of the hardest things to understand in an object- oriented program is the overall flow of control. One of the hardest things to understand in an object- oriented program is the overall flow of control. A good design has lots of small methods in different classes and at times it can be tricky to figure out the overall sequence of behavior A good design has lots of small methods in different classes and at times it can be tricky to figure out the overall sequence of behavior Sequence diagram helps you see the sequence Sequence diagram helps you see the sequence valuable for concurrent process valuable for concurrent process

a Transaction coordinator a first Transaction checker a second Transaction Checker new OK all done all done be Valid Concurrent processes and activation asynchronous message other processing suppressed

Sequence diagram 請看一下下面兩張 sequence diagram 請看一下下面兩張 sequence diagram

Comments Sequence diagram 並不擅長展示有 loop 等的 演算法 Sequence diagram 並不擅長展示有 loop 等的 演算法 適合展示某個複雜的互動情境 適合展示某個複雜的互動情境

建立與刪除物件

Comments Sequence diagram 並不擅長展示有 loop 等的 演算法 Sequence diagram 並不擅長展示有 loop 等的 演算法 適合展示某個複雜的互動情境 適合展示某個複雜的互動情境 Loops, Conditionals, and the Like A common issue with sequence diagrams is how to show looping and conditional behavior. The first thing to point out is that this isn't what sequence diagrams are good at. If you want to show control structures like this, you are better off with an activity diagram or indeed with code itself. Treat sequence diagrams as a visualization of how objects interact rather than as a way of modeling control logic.

procedure dispatch foreach (lineitem) if (product.value > $10K) careful.dispatch else regular.dispatch end if end for if (needsConfirmation) messenger.confirm end procedure

Loop and alternative frame Loop 以及 alternative 框架是 UML 2.0 之後才 Loop 以及 alternative 框架是 UML 2.0 之後才有的 有些人不喜歡 loop 以及 alternative 框架,而 自行採用其他的方法如下圖 有些人不喜歡 loop 以及 alternative 框架,而 自行採用其他的方法如下圖

Frame option alt Alternative multiple fragments; only the one whose condition is true will execute (Figure 4.4). opt Optional; the fragment executes only if the supplied condition is true. Equivalent to an alt with only one trace (Figure 4.4). par Parallel; each fragment is run in parallel. loop Loop; the fragment may execute multiple times, and the guard indicates the basis of iteration (Figure 4.4). region Critical region; the fragment can have only one thread executing it at once. neg Negative; the fragment shows an invalid interaction. ref Reference; refers to an interaction defined on another diagram. The frame is drawn to cover the lifelines involved in the interaction. You can define parameters and a return value. sd Sequence diagram; used to surround an entire sequence diagram, if you wish.

Collaboration Diagram The sequence is indicated by numbering the message The sequence is indicated by numbering the message the spatial layout allows you to show other things more easily the spatial layout allows you to show other things more easily show how object link together show how object link together you can overlay packages or other information more easily you can overlay packages or other information more easily

:Order Entry Window :Order Macallan Line: Order Line :Delivery Item Macallan Stock:StockItem :Reorder Item 1:prepare() 2: *[for all order lines]: prepare() 3:has Stock:=check() 4:[has Stock]:remove() 5:needsReorder := needToReorder() 6:[needsReoder]:new 7:[hasStock]:new object message sequence number selfdelegation

Sequence or Collaboration? different people have different preference for different situation different people have different preference for different situation interaction diagrams can awkward to use when exploring alternatives interaction diagrams can awkward to use when exploring alternatives

How to find methods (behaviors, operations) of object 好,你應該知道要怎麼樣以 sequence diagram 描述物件之間的互動 好,你應該知道要怎麼樣以 sequence diagram 描述物件之間的互動 重點是,你的物件的 method 根本還沒有個 譜? 重點是,你的物件的 method 根本還沒有個 譜? 你怎麼找他們? 你怎麼找他們?

9.2. The KRB Seven-Step Method. Step  Operations (i.e., Behavior) 1. By Inspection 2. Basic CRUD 3. Use Cases 4. Statechart Diagram 5. CRC Cards 6. CRUD Revisited Six techniques for Finding Operations

What is a use case ? 使用案例 (系統使用情境 scenario ) 使用案例 (系統使用情境 scenario ) Use cases 是你的系統所要完成的功能 Use cases 是你的系統所要完成的功能 這些功能當然要由你所設計的 objects 互動 來完成 這些功能當然要由你所設計的 objects 互動 來完成 請看上次的規格書 請看上次的規格書

What is a scenario ( 情境) A scenario is a sequence of steps describing an interaction between a userand a system. So if we have a Web-based on-line store, we might have a Buy a Product scenario that would say this: The customer browses the catalog and adds desired items to the shopping basket. When the customer wishes to pay, the customer describes the shipping and credit card information and confirms the sale. The system checks the authorization on the credit card and confirms the sale both immediately and with a follow-up .

What is a use case? 一個使用案例是一組(系統使用,或系統 操作)情境來達成某個目標 一個使用案例是一組(系統使用,或系統 操作)情境來達成某個目標 一個趨勢是規格書的寫法漸漸由 use cases 所取代,尤其是軟體代工產業 一個趨勢是規格書的寫法漸漸由 use cases 所取代,尤其是軟體代工產業

Use Case diagram

use case 干尋找物件 method 啥事 一旦有了 use case ( 可以有正式文件,或者是 建模者自行寫下一些 scenario 一旦有了 use case ( 可以有正式文件,或者是 建模者自行寫下一些 scenario Scenarios (use cases) 是系統行為的起頭 Scenarios (use cases) 是系統行為的起頭 每一個 use case 最終一定要由系統中的物件 來完成 每一個 use case 最終一定要由系統中的物件 來完成 OK , 接著? OK , 接著?