0% found this document useful (0 votes)
51 views11 pages

10 InteractionModeling

The interaction model describes how objects interact by exchanging messages over time. It complements the class and state models by showing behavior from the perspective of message passing between objects. Sequence diagrams are commonly used to model interactions by showing the participants, sequence of messages exchanged, and activations of objects over time at a specific level of abstraction like a use case. Key elements include participants, messages, lifelines to indicate time, and notation for method calls, object lifetimes, and control structures like selection and loops.

Uploaded by

neha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views11 pages

10 InteractionModeling

The interaction model describes how objects interact by exchanging messages over time. It complements the class and state models by showing behavior from the perspective of message passing between objects. Sequence diagrams are commonly used to model interactions by showing the participants, sequence of messages exchanged, and activations of objects over time at a specific level of abstraction like a use case. Key elements include participants, messages, lifelines to indicate time, and notation for method calls, object lifetimes, and control structures like selection and loops.

Uploaded by

neha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Interaction Model

Interaction Model
• The class model describes the objects in a system
and their relationships
• The state model describes the life cycles of the
objects
• The interaction model describes how the objects
interact
• Both state model and interaction model are
needed to describe behavior fully. They view
behavior from different perspective
Interaction Model
• Can be modelled at different level of
abstraction
– At high level, Use cases describes how a system
interacts with outside actors
– Sequence diagrams provide more detail and show
the messages exchanged among a set of objects
over time
– Activity diagrams provide details and show the
flow of control among the steps of a computation
Sequence Diagram

• Sequence diagram
– Shows the participants in an interaction and the
sequence of messages among them
– Shows the interaction of a system with its actors to
perform all or part of a use case
Key parts of a Sequence Diagram
• participant: an object or entity that acts in the
sequence diagram
• message: communication between participant
objects
• The axes in a sequence diagram:
– horizontal: which object/participant is acting
– vertical: lifeline ( time – top -> bottom ) (spacing is
irrelevant)
Representing objects
• Squares with object type, optionally preceded
by object name and colon
– write object's name if it clarifies the diagram
– object's "life line" represented by dashed vert. line
Messages between objects
• message (method call) indicated by horizontal
arrow to other object
– write message name and arguments above arrow
Messages, continued
• message (method call) indicated by horizontal
arrow to other object
– dashed arrow back indicates return
– different arrowheads for normal / concurrent
(asynchronous) methods
Lifetime of objects
• creation: arrow
with 'new' written
above it
– notice that an object
created after the
start of the scenario
appears lower than
the others

• deletion: an X at
bottom of object's
lifeline
Indicating method calls
• activation: thick box over object's life line;
drawn when object's method is on the stack
– either that object is running its code, or it is on the
stack waiting for another object's method to finish
– nest to indicate recursion

Activation

Nesting
Indicating selection and loops
• frame: box around part of a sequence diagram to indicate selection or
loop
– if -> (opt) [condition]
– if/else -> (alt) [condition], separated by horizontal dashed line
– loop -> (loop) [condition or items to loop over]

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy