Interaction Diagrams PB007 Software Engineering I Bruno Rossi 05. 12. 2016 Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 1 / 15 Interaction Diagrams Interaction diagrams model the cooperation of classes/objects/actors for the implementation of use cases (or parts of them). We distinguish 4 main types, each of which gives a view of a different aspect of the interaction: 1. Sequence diagrams capture the communication between classes/objects with an emphasis on the temporal sequence when passing messages. 2. Communication diagrams capture communication with an emphasis on relationships between classes/objects. Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 2 / 15 Interaction Diagrams II 3. Timing diagrams model time constraints of the interactions of objects in real time. 4. Interaction overview diagrams are a special case of activity diagrams, which show a top view of the connections between the complex sub-interactions. Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 3 / 15 Sequence diagram Sequence diagrams show the interaction as a time-ordered sequences of messages between objects/classes/actors. Basic elements: Actors, classes, objects Lifelines Activations (focus of control) Messages Combined Fragments Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 4 / 15 Sequence diagram - Example Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 5 / 15 Sequence diagram - Example II Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 6 / 15 Sequence diagram - Combined Fragments Combined fragments divide the sequence diagram in more areas with different behavior. Each combined fragment is marked with an oper´ator, one or more operands, and condition(s). The most important operators are: opt (option) - has one operand, which is triggered only if the defined condition is met alt (alternatives) - the operand whose condition is evaluated to true will be launched. loop - repeated execution of the operand break - operand is executed if it meets any conditions and terminates the execution cycle Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 7 / 15 Sequence diagram - Combined Fragments II Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 8 / 15 Sequence diagram - Combined Fragments III Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 9 / 15 Communication Diagram Communication Diagrams capture the interactions of objects/classes that communicate with each other. The basic elements: Actors, classes, objects connections (links) Messages Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 10 / 15 Communication Diagram - Example Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 11 / 15 Communication Diagram - Iterations Iterations are expressed in communication diagram using the iteration expression. Syntax: * [loop min, max [condition]] Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 12 / 15 Communication Diagram - Branching Branching in the communication diagram is obtained by adding guarding conditions to communications. The message is sent only in case that the condition evaluates to true. Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 13 / 15 Tasks Open the use case model and the classes and for each use case look at the objects that are involved in the various functionalities Select the 5 most interesting (sufficiently complex) use cases Model 2 of them (the simpler ones) by means of a communication diagram Model the remaining 3 by means of sequence diagrams When modelling the interaction diagrams, update the class diagram with operations that might be necessary Upload the PDF report into folder (Week 10). Deadline: Saturday, 10.12.16 23:59 Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 14 / 15 Customization of PDF Reports Software Engineering I (PB007) Interaction Diagrams 05. 12. 2016 15 / 15