下载此文档

10uml交互图.ppt


文档分类:IT计算机 | 页数:约43页 举报非法文档有奖
1/43
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/43 下载此文档
文档列表 文档介绍
1面向对象分析与设计 UML 交互图叶文来 UML 交互图?描述对象间通过消息的交互?用于动态对象建模?有两种类型: –顺序图( sequence diagram) –通信图(communication diagram) –交互纵览图 23何时需要绘制交互图?交互图–是验证逻辑使逻辑清晰的好办法–发现瓶颈的一种很好的机制–用于动态对象建模。类图是静态视图,交互图是动态视图–在用例和类模型之间搭起一座桥梁?描述对象之间以及对象与参与者之间的消息发送关系?发现类并依据其职责构建类的属性和方法–考虑 OO 设计细节时,要落实发送哪些消息、发送给谁、以何种顺序发送为用例绘制交互图时有问题,很可能是你编写的用例不正确! 顺序图?显示用例的行为序列?显示了用例流程中不同对象之间的调用关系?对象、类和参与者都在顺序图中进行描述 4 : A myB : B doTwo doOne doThree public class A { private B myB=new B(); public void doOne() { (); (); } //……} 通信图?以网格方式描述对象交互。 5 : A myB : B 1 : doTwo 2 : doThree doOne6顺序图和通信图?同质的模型,在 CASE 工具中可相互转换?顺序图表示调用流的顺序,由上至下,直观?通信图节省表示空间: Register : Sale makePayment ( cashTendered ) makePayment ( cashTendered ) : Payment create ( cashTendered ) 1 : makePayment ( cashTendered ) : create ( cashTendered ) : Register : Sale : Payment makePayment ( cashTendered ) direction of message 交互图表示法?使用生命线框图表示参与者 7 sales : ArrayList < Sale > : Sales 1 : 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 < Sale > 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 legal8 ?消息格式–方括号所括的是可选部分– message-name: 消息名– argument-list: 消息的参数列表–示例 P165 [return-value:=]message-name ([argument-list]) :returnType ?单实例类对象–对象实例化时,只能存在一个实例–在生命线框图右上角标识“1”9顺序图基本表示法?生命线框、消息、控制期和执行活动条 10 : Register : Sale doA doB doXdoC doD typical sychronous message shown with a filled - arrow line a found message whose sender will not be specified execution specificat

10uml交互图 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数43
  • 收藏数0 收藏
  • 顶次数0
  • 上传人ranfand
  • 文件大小2.17 MB
  • 时间2016-08-06