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