Understanding Object Interactions in System Models: Interaction Diagrams, Slides of Object Oriented Programming

An in-depth exploration of interaction diagrams, a type of system modeling used to document object interactions and collaborations. Various forms of interaction diagrams, including sequence diagrams, collaboration diagrams, and crc cards. It explains how these diagrams help in realizing use cases, identifying class associations, and understanding activations and live interactions. The document also discusses the differences between sequence and collaboration diagrams, message naming conventions, and the creation and deletion of objects.

Typology: Slides

2011/2012

Uploaded on 07/17/2012

banani
banani 🇮🇳

4.3

(3)

91 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Interaction Diagrams
Lecture 22
2
System Models
nDynamic Models
nactivity diagrams
nstatechart diagrams
ninteraction diagrams
nsequence diagrams
ncollaboration
diagrams
nUse Case Models
nuse case diagrams
nStructural Models
nclass diagrams
npackages
nArchitectural
Models
ncomponent diagrams
ndeployment
diagrams
3
CRC Cards and Interaction
Diagrams
nCRC cards were used to validate the class model (i.e., the class
model realizes the use cases)
nInteraction diagrams allows to document in detail which objects
interact and how
nWe may use CRC cards to explore objects and their interactions,
and we may use Interaction Diagrams to record the happenings
precisely
nDevelop Interaction Diagrams only for complex use cases, to
communicate with the developers regarding the use case
realization
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Understanding Object Interactions in System Models: Interaction Diagrams and more Slides Object Oriented Programming in PDF only on Docsity!

Interaction Diagrams

Lecture 22

2

System Models

n Dynamic Models

n activity diagrams

n statechart diagrams

n interaction diagrams

n sequence diagrams

n collaboration

diagrams

n Use Case Models

n use case diagrams

n Structural Models

n class diagrams

n packages

n Architectural

Models

n component diagrams

n deployment

diagrams

3

CRC Cards and Interaction

Diagrams

n CRC cards were used to validate the class model (i.e., the class

model realizes the use cases)

n Interaction diagrams allows to document in detail which objects

interact and how

n We may use CRC cards to explore objects and their interactions,

and we may use Interaction Diagrams to record the happenings

precisely

n Develop Interaction Diagrams only for complex use cases, to

communicate with the developers regarding the use case

realization

docsity.com

4

Main uses of Interaction

Diagrams

n To show how a use case is realized inside the system

n To identify associations between classes and

operations needed on them

5

Two forms of Interaction

Diagrams

n Instance form: Shows just one sequence or

scenario

n Generic form: Shows all (or more than one)

alternate sequences of messages or scenarios

6

Collaborations

n Collaboration is the realization of use case

n Collectively, the objects which interact to perform some task,

with the links between them, are known as collaboration

n This is a collaboration (without interactions)

: Book

: LibraryMember : Copy

: BookBorrower

docsity.com

10

Tracking the Live Activations

n Sometimes a nested numbering scheme (hierarchical

numbering) is followed for tracking the stack of

objects with live activations

n General Formula: Whenever an object O receives a

message, the number of that message is used as a

prefix of all the messages that are sent until O sends

a response to the message

11

Collaboration Diagram with

Nested Numbers

: Book

: LibraryMember : Copy

: BookBorrower

1: borrow(theCopy)

1.1: okToBorrow

1.2: borrow

1.2.1: borrowed

12

Collaboration Diagram

n definition : interaction diagram that

emphasizes the structural organization of the

objects that send and receive messages

n Shows:

n objects

n links and messages passing between objects

docsity.com

13

Sequence Diagram

n definition : interaction diagram that

emphasizes time ordering of messages

n x axis

n objects

n object that initiates interactions towards left

n increasingly more subordinate to right

n y axis

n messages ordered in increasing time from top to

bottom

14

Sequence vs. Collaboration

Diagram

n Semantically equivalent, except:

n Sequence diagrams have:

n object lifelines: vertical dashed line

representing life of object

n focus of control: tall, thin rectangle showing

period of time which an object is performing an

action (period of live activation)

n Collaboration diagrams have:

n path: indicates that one object is linked to

another

15

Objects, Lifelines, Activations,

and Messages

docsity.com

19

Creation and Deletion of Objects

in Collaboration Diagram

: HoD {new}

: Lecturer {destroyed} : Registrar

1: n := getName()

3: destroy()

2: new HoD(n)

If an object is both created and

destroyed in the same

interaction, it can be labeled as

{transient} which is equivalent

for {new and destroyed}

20

Generic Form of Sequence

Diagram

: Computer : Queue

Print(file) : PrintServer : Printer

Print(file) (^) [printer free] Print(file)

[printer busy] Store(file)

Guard condition

Return

continues…

docsity.com