Chapter 8 - Modeling interactions and behavior. In this chapter, we look at how to model system dynamics, focusing on two aspects: interactions and behavior. An interaction model shows a set of actors and objects interacting by exchanging messages. A behavior model shows how an object or system changes state in reaction to a series of events. | Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour 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. © Lethbridge/Laganière 2001 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. . method calls, messages send over the network These are all referred to as messages. © Lethbridge/Laganière 2001 Elements found in interaction diagrams Instances of . | Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour 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. © Lethbridge/Laganière 2001 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. . method calls, messages send over the network These are all referred to as messages. © Lethbridge/Laganière 2001 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 © Lethbridge/Laganière 2001 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 © Lethbridge/Laganière 2001 Sequence diagrams – an example requestToRegister addToSchedule > :Student :Registration :CourseSection addToRegistrationList * * * * * * * * * * * * CourseSection requestToRegister Registration Course getPrerequisite Student addToSchedule hasPassedCourse addToRegistrationList © Lethbridge/Laganière 2001 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