《面向对象软件工程》课程PPT教学课件(英文版)Chapter 8:Modelling Interactions and Behaviour

object-Oriented Software Engineering Practical Software development using uml and Java Chapter 8: Modelling Interactions and behaviour www.oseng.com
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour

8.1 Interaction Diagrams Interaction diagrams are used to model the dynamic aspects of a software system They help you to visualize how the system runs An interaction diagram is often built from a use case and a class diagram - The objective is to show how a set of objects accomplish the required interactions with an actor www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 2 8.1 Interaction Diagrams Interaction diagrams are used to model the dynamic aspects of a software system • They help you to visualize how the system runs. • An interaction diagram is often built from a use case and a class diagram. —The objective is to show how a set of objects accomplish the required interactions with an actor

Interactions and messages Interaction diagrams show how a set of actors and objects communicate with each other to perform The steps of a use case or -The steps of some other piece of functionality The set of steps taken together is called an interaction Interaction diagrams can show several different types of communication e. g. method calls, messages send over the network These are all referred to as messages www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 3 Interactions and messages • Interaction diagrams show how a set of actors and objects communicate with each other to perform: —The steps of a use case, or —The steps of some other piece of functionality. • The set of steps, taken together, is called an interaction. • Interaction diagrams can show several different types of communication. —E.g. method calls, messages send over the network —These are all referred to as messages

Elements found in interaction diagrams Instances of classes Shown as boxes with the class and object identifier underlined Actors use the stick-person symbol as in use case diagrams messages Shown as arrows from actor to object, or from object to object www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour 4
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 4 Elements found in interaction diagrams • Instances of classes —Shown as boxes with the class and object identifier underlined • Actors —Use the stick-person symbol as in use case diagrams • Messages —Shown as arrows from actor to object, or from object to object

Creating instances diagrams You should develop a class diagram and a use case model before starting to create an interaction diagram. There are two kinds of interaction diagrams -Sequence diagrams -Collaboration diagrams www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 5 Creating instances diagrams You should develop a class diagram and a use case model before starting to create an interaction diagram. • There are two kinds of interaction diagrams: —Sequence diagrams —Collaboration diagrams

Sequence diagrams- an example Course section Student requestToRegister : Registration > addTo Schedule add ToRegistrationList Course CourseSection Registration Student getPrerequisite request To Register add ToSchedule add To RegistrationList hasPassedCourse www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour 6
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 6 Sequence diagrams – an example requestToRegister addToSchedule > :Student :Registration :CourseSection addToRegistrationList * CourseSection * * requestToRegister Course Registration getPrerequisite Student addToSchedule hasPassedCourse addToRegistrationList

Sequence diagrams A sequence diagram shows the sequence of messages exchanged by the set of objects performing a certain task The objects are arranged horizontally across the diagram An actor that initiates the interaction is often shown on the left The vertical dimension represents time A vertical line, called a lifeline, is attached to each object or actor The lifeline becomes a broad box, called an activation box during the live activation period A message is represented as an arrow between activation boxes of the sender and receiver - a message is labelled and can have an argument list and a return value www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 7 Sequence diagrams A sequence diagram shows the sequence of messages exchanged by the set of objects performing a certain task • The objects are arranged horizontally across the diagram. • An actor that initiatesthe interaction is often shown on the left. • The vertical dimension representstime. • A vertical line, called a lifeline, is attached to each object or actor. • The lifeline becomes a broad box, called an activation box during the live activation period. • A message is represented as an arrow between activation boxes of the sender and receiver. —A message is labelled and can have an argument list and a return value

Sequence diagrams same example, more details GUI Course Section a Student: Course Student I request ToRegister requestToRegister (astudent) as Prerequisite getPrerequsiter囗 sPassedcourse (prereq [hasPrerequisite > Registration add ToRegistrationList add ToSchedule I www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour 8
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 8 Sequence diagrams – same example, more details requestToRegister (aStudent) addToSchedule aStudent: Student :Registration GUI :CourseSection requestToRegister :Course [hasPrerequisite] > prereq := getPrerequisite hasPrerequisite := hasPassedCourse(prereq) addToRegistrationList

Sequence diagrams an example with replicated messages An iteration over objects is indicated by an asterisk preceding the message name Bill Purchase Item for all PurchaselgetSubtotal ge uNitpRice ompu te Total Bill Purchase Item quantity pnce www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 9 • An iteration over objects is indicated by an asterisk preceding the message name * Purchase * quantity Bill Item price *[for all Purchase] getSubtotal :Bill :Item getUnitPrice computeTotal :Purchase Sequence diagrams – an example with replicated messages

Sequence diagrams an example with object deletion If an object' s life ends, this is shown with an x at the end of the lifeline Speci ficFlight Booking Passen gerRole cancelBookings cancel de lete fromltine ran de lete From Passen gerlist www.oseng.com O Lethbridge/Laganiere 2001 Chapter 8: Modelling Interactions and behaviour
© Lethbridge/Laganière 2001 Chapter 8: Modelling Interactions and Behaviour 10 • If an object’s life ends, this is shown with an X at the end of the lifeline Sequence diagrams – an example with object deletion cancelBooking deleteFromItinerary cancel :SpecificFlight :Booking :PassengerRole deleteFromPassengerList
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 1. Software and Software Engineering.pdf
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 6:Using Design Patterns.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 5:Modelling with Classes.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 4:Developing Requirements.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 3:Basing Software Development on Reusable Technology.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 2:Review of Object Orientation.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 1:Software and Software Engineering.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 7:Focusing on Users and Their Tasks.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)总目录.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)导论(主讲:武长柱).ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)复习.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp14电子商务发展中的法律法规.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp9 电子商务开发技术.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp8 电子政务.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp7 物流与供应链管理.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp6 客户关系管理.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp5 网络银行与支付.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp4 网络营销与管理.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp3 电子商业与贸易.ppt
- 徐州工程学院:《电子商务概论》课程教学资源(PPT课件讲稿)chp2 电子商务机理与模式.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 9:Architecting and Designing Softwarech09.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 10:Testing and Inspecting to Ensure High Quality.ppt
- 《面向对象软件工程》课程PPT教学课件(英文版)Chapter 11:Managing the Software Process.ppt
- 《PPT应用与计算机安全》讲义.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第10章 滤镜(上).ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第11章 滤镜(下).ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第1章 初识Photoshop 7.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第2章 基础工具.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第3章 绘图工具.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第4章 油漆桶和渐变工具.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第5章 路径及形状处理工具.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第6章 文字工具.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第7章 其他工具.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第8章 图层与蒙版第8章.ppt
- 《新标准中文版Photoshop7基础培训教程》教学资源(PPT课件讲稿)第9章 通道的应用.ppt
- 《数字图象处理》第一章 Windows 位图和调色板.doc
- 《数字图象处理》第十章 图象处理编程工具及简单的多媒体编程.doc
- 《数字图象处理》第二章 图象的几何变换.doc
- 《数字图象处理》第三章 图象的平滑(去噪声)、锐化.doc
- 《数字图象处理》第四章 图象的半影调和抖动技术.doc