复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 15 - UML交互图

Chapter 15 UML交互图·。 ●●●●● ●●●● ●●。●●
Chapter 15 UML交互图

●●●●● ●●●● 目标 ●●● ●●●● ●●0● 学习UML交互图(顺序图和通信图)
目标 ⚫ 学习UML交互图(顺序图和通信图)

●●● ●●●●● ●●●● 简介 ●●● ●●●● ●●0● UML使用交互图( interaction diagram)来描述 对象间消息的交互,用于动态对象建模。 ●交互图有两种类型: ●顺序图( sequence diagram) 通信图( communication diagram)
简介 ⚫ UML使用交互图(interaction diagram)来描述 对象间消息的交互,用于动态对象建模。 ⚫ 交互图有两种类型: ⚫ 顺序图(sequence diagram) ⚫ 通信图(communication diagram)

●●● ●●●●● ●●●● 顺序图的示例 ●●● ●●●● ●●0● public class At A my B: B private B my B= new BO public void dooner doone my B do Two: do two my B. doThreeo do three
顺序图的示例 : A myB : B doTwo doOne doThree public class A{ private B myB = new B(); public void doOne(){ myB.doTwo(); myB.doThree(); } }

●●● ●●●●● ●●● 通信图的示例 ●●● ●●●● ●●0● public class At door private B my B= new BO public void dooner 1: doTwo my B do Two: 2 dothree my B. doThreeo my B
通信图的示例 public class A{ private B myB = new B(); public void doOne(){ myB.doTwo(); myB.doThree(); } } : A myB : B 1: doTwo 2: doThree doOne

●●● ●●● ●●●●● ●●●● 顺序图和通讯图的优点和缺点 ●●● ●●●● ●●0● ●顺序图 ●优点:能够清楚地表示详细的顺序和时间排序,有 丰富的表示法 缺点:强制在右侧增加对象,消耗水平空间 通信图 ●优点:有效利用空间 ●缺点:不易查阅消息的顺序,表示法不够丰富
顺序图和通讯图的优点和缺点 ⚫ 顺序图 ⚫ 优点:能够清楚地表示详细的顺序和时间排序,有 丰富的表示法 ⚫ 缺点:强制在右侧增加对象,消耗水平空间 ⚫ 通信图 ⚫ 优点:有效利用空间 ⚫ 缺点:不易查阅消息的顺序,表示法不够丰富

●●● ●●●●● ●●● 交互图表示法的公共元素 ●●● ●●●● ●●0● 对象及单实例对象 消
交互图表示法的公共元素 ⚫ 对象及单实例对象 ⚫ 消息

●●●●● ● ●●● 使用生命线框图表示参与者 ●●● ●●●● ●●0● lifeline box representing an lifeline box representing a Font, or more precisely, that Font is unnamed instance of class sale named instance instance of class class-an instance of a metaclass aclass》 Sale s1: Sale List is an interface lifeline box representing an feline box representing instance of an Array List class, one instance of class sale in UML 1.x we could not use an parameterized templatized)to selected from the sales terface here, but in UML 2, this(or hold Sale objects Array List collection an abstract class)is legal x: List Array List sales[i]: Sale example
使用生命线框图表示参与者 sales: ArrayList :Sale s1 : Sale lifeline box representing an instance of an ArrayList class, parameterized (templatized) to hold Sale objects lifeline box representing an unnamed instance of class Sale lifeline box representing a named instance sales[ i ] : Sale lifeline box representing one instance of class Sale, selected from the sales ArrayList collection x : List «metaclass» Font lifeline box representing the class Font, or more precisely, that Font is an instance of class Class – an instance of a metaclass related example List is an interface in UML 1.x we could not use an interface here, but in UML 2, this (or an abstract class) is legal

●●●●● ●●●● ●●● 单实例类对象 ●●●● ●●0● Register Store the‘1 implies this is a Singleton and accessed doX via the singleton pattern
单实例类对象 : Register 1 : Store doA doX the ‘1’ implies this is a Singleton, and accessed via the Singleton pattern

●●● ●●●●● ●●●● 消息表达式 ●●● ●●●● ●●0● ●交互图展示了对象之间的消息;UML对于这些 消息表达式具有标准语法: return message(parameter: parameter Type, .. return T ype initialize(code) initialize d= getProductDesc(id d= getProductDesc(id: ItemID) d= getProductDesc(id: ItemID): ProductDescription
消息表达式 ⚫ 交互图展示了对象之间的消息;UML对于这些 消息表达式具有标准语法: return = message(parameter : parameterType,….):returnType ⚫ 例 initialize(code) initialize d = getProductDesc(id) d = getProductDesc(id : ItemID) d = getProductDesc(id : ItemID) : ProductDescription
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 14 - 迈向对象设计.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 13 - 逻辑架构和UML包图.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 11 - 操作契约.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 10 - 系统顺序图.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 9 - 领域模型.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 8 - 细化阶段的迭代——基础.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 7 - 其他需求.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 6 - 用例.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 4 Chapter 5 - 初始阶段的需求.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 3 - 案例分析 THE NEXTGEN POS SYSTEM.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_OOP:Object-Oriented Programming.pptx
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 2 - 迭代、进化和敏捷.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 1 - 面向对象分析和设计.ppt
- 复旦大学:《面向对象分析和设计》课程资料_课程注册系统_9-11 UC Design、Subsystem Design、Class Design.pdf
- 复旦大学:《面向对象分析和设计》课程资料_课程注册系统_6-8 Identify Design Elements、RunTime Architecture、Describe Distribution.pdf
- 复旦大学:《面向对象分析和设计》课程资料_课程注册系统_1-5 最佳实践、需求、分析设计、架构分析、用例分析.pdf
- 复旦大学:《面向对象分析和设计》课程资料_Exception handling refactorings.pdf
- 复旦大学:《面向对象分析和设计》课程资料_Error Handling.pdf
- 复旦大学:《面向对象分析和设计》课程资料_AntiPattern_2.Servlet.pdf
- 复旦大学:《面向对象分析和设计》课程资料_AntiPattern_1.JSP J2EE Refactoring Patterns/AntiPatterns.pdf
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 16 - UML类图.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 17 - GRASP基于职责设计对象.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 18 - 使用GRASP的对象设计示例.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 19 Chapter 20 Chapter 22.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 21 测试驱动的开发与重构.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_复习:OOAD部分.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_AOP Aspect Oriented Programming.pptx
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Hibernate Persistence.ppt
- 复旦大学:《面向对象分析和设计》课程资料_UML和模式_Hibernate 演示场景.pptx
- 复旦大学:《电子商务》课程资源_教学大纲.pdf
- 复旦大学:《电子商务》课程资源_教学案例:The Business Model-Recent Developments and Future Research-JOM2011.pdf
- 复旦大学:《电子商务》课程资源_教学研究:Online Game Addiction among Adolescents_Motivation and Prevention Factors.pdf
- 复旦大学:《电子商务》课程资源_教学研究:Research On The Utility Of An Advanced ACA In Context-Aware Tour Planning System.pdf
- 复旦大学:《电子商务》课程PPT课件_第二次课 电子商务的商业模式与分类.ppt
- 复旦大学:《电子商务》课程PPT课件_第一次课 引言(胥正川).ppt
- 复旦大学:《电子商务》课程PPT课件_第三次课 电子商务过程及相关因素(电子商务创业).ppt
- 复旦大学:《电子商务》课程PPT课件_第四次课 电子商务商业计划书写作 Creating a Winning E-Business Second Edition.ppt
- 复旦大学:《电子商务》课程PPT课件_第七次课 B2C电子商务——网上零售.pptx
- 复旦大学:《电子商务》课程PPT课件_第九次课 B2B电子商务(B2B行业平台).ppt
- 复旦大学:《电子商务》课程PPT课件_第五次课 商业模式的概念与内涵(发现商业模式).ppt