Unit 4 Interaction Diagrams

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

Represenation of interactions

1)How interaction goes? (together with objects and messages)


A)Interaction goes together with objects and messages
2)How interaction is represented?(by time ordering and structural organizatio
of objects)
A)Interaction is represented by time ordering of its message with sequence
diagrams and by structural organization of these objects that send and receive
messages using collaboration diagrams
Common Modeling Techniques
Modelling a Flow of control( 1. setting the context for interaction
2.setting the stage for interaction
3.setting the structural organization
4.Specifying time order
5.convery necessary details of interaction
1)How to model a flow of control?(context,stage,structural rganization,specifying
time order, convey necessary details)(CSSSC)
A)A flow of control can be modeled by using the following steps
step 1:Setting the context for interaction( individual operation,a class, whole
system)
Step2: Setting the stage for interaction(identifying objects, setting their
properties,state, roles)
Step3:Setting the structural organization(identifying links and relevant paths)
Step4:Specifying time order(messages, differentiating messages, their parameters
and return values)
Step5: Convey necessary details(adorn in each object at every moment with its
state and role)

1
2)What may be the context for interaction?(individual operation, system as a
whole , a class)
A)The Context for the interaction may be 1)an individual operation 2)the system as
a whole 3) a Class

3)How to set the stage for interaction?( by identifying objects , set their
properties like state and role)
A)We need to set the stage for the interaction by identifying which objects play a
role, set their initial properties like their attribute values,state, and role
4)How to set the structural organization of objects?(by identifying the links and
relevant paths)
A)We can set the structural organization of objects by identifying the links that
connect them , identifying the relevant paths of communication that take place in
this interaction
5)What we can specify in time order?(messages , distinguish different kinds of
messages,messages with parameter
and return values etc)
A)In time order we can specify the messages that pass from object to object , we
can distinguish the different kinds of message which include parameters and return
values to convey the necessary detail of this interaction.
6)How to convey necessary details of interaction?(with its state and role)
A)We convey the necessary detail of this interaction , adorn each object at every
moment in time with its state and role
7)Diagram of Flow of control by time(publish/subscribe mechanism)
A)Following diagram shows a set of roles that interact in the context of a publish
and subscribe mechanism ,here the diagram includes three roles
1) P(a StockQuotePublisher),s1,and s2(both instanes of StockQuoteSubscribe)
This figure is an example of a sequence diagram, which emphasizes the time order
of messages

2
Figure 16-6. Flow of Control by Time

8)Diagram for flow of control by organization

A) The following diagram is semantically equivalent to the previous one, but it is


drawn as a communication diagram, which emphasizes the structural organization
of the objects. This figure shows the same flow of control, but it also provides a
visualization of the links among these objects.

3
Example diagram 2

4
Interaction diagrams
1)What an interaction diagram shows?(interactions among objects,
relationships,messages dispatched)
A)An interaction diagram shows an interaction , consisting of a set of objects and
their relationships, including the messages that may be dispatched among them
2)What the interaction diagrams commonly contains?(objects,links ,messages)
A)Interaction diagrams commonly contain objects ,links and messages
3)What they can model? (dynamic aspects of a system)
A)Interaction diagrams may be used to model the dynamic aspects of a system
4)What it may contain?(notes and constraints)
A)An interaction diagram may contains notes and constraints
5)what is the use of interaction diagrams?(to project elements found in an
interaction)

5
A)An interaction diagram is basically a projection of the elements found in an
interaction.
Terms and concepts used in interaction diagrams(common

properties,contents,objects,links,messages,synchronous
and asynchronous messages)
1)What are various types of interaction diagrams?(sequence , collaboration)
A)There are two types of interaction diagrams as given below
1)Sequence diagrams 2)Collaboration Diagrams
2)Common Properties
1)What are the common properties of interaction diagram?(name ,graphical
content)
A)The most common properties of an interaction diagram are its name and the
graphical content which gives a projection into a model
2)How to differentiate interaction diagrams from another?(by using the
content of the diagram)
A)It is mainly the content of the diagram which is of high importance and its
distinguishable feature
3)What a sequence diagram shows?(set of objects and messages sent and
received by them)
A)A sequence diagram shows a set of objects and messages sent and received by
them
4)What a collaboration diagram shows?(set of objects,links ,messages)
A)A collaboration diagram contain set of objects ,links and the messages sent and
receive by them
5)are both sequence and collaboration diagrams are equal?(semantically equal
,inter convertible )

6
A)Both the types of interaction diagrams i.e sequence diagrams and collaboration
diagrams are semantically equal, that is they are inter convertible. We can convert
a diagram of one form into other without loss of any information
Contents
1)What are the contents of interaction diagrams?
(objects,links,messages,constraints and notes)
A)The contents of an interaction diagrams are objects, links and messages, apart
from these, they may contain constraints and notes
Objects
1)What are objects?(real world entities ,encapsulated in class, any no of objects)
A)Objects represents real world entities , which can be distinguished from one
another .They are encapsulated in the class. There can be any number of objects in
a class communicating with each other
Links
1)What are links?(semantic connection, plays a major role in sequence diagrams)
A)It is said to be a semantic connection among objects. Link also plays a major
role in sequence diagram by connecting different objects
Messages
1)What are messages?(information carriers between objects)
A)Messages are said to be the information carrier between the objects
2)What it gives?(information about one object offering services to other and
getting services from other)
A)A message gives information about what one object is offering the services to
another object or the services it is getting from another object
Synchronous and Asynchronous messages
1)What are Synchronous messages?(processed each at a time,making the
transmitter object wait)

7
A)The messages which are processed each at a time making the transmitter object
to wait till the completion of processing
2)Representation of synchronous messages?

3)What are asynchronous messages?(transmitter object need not wait for


receiving object to complete its processing)
A)Similarly asynchronous messages are quite opposite to that of synchronous
message. In this case the transmitter object is facilitated to send message without
waiting for the receiving object to complete its processing.
Hence in asynchronous ,more than one message at a given instance can be
processed .
4)Representation of asynchronous messages

8
Diagram for interactions?

7)Diagram for collaboration

9
Sequence Diagrams
1)What is a sequence diagram?(an interaction diagram , time ordering of
messages)
A)It is an interaction diagram that emphasized the time ordering of messages
2)Graphical representation?(in a table , objects along X axis messages along Y
axis)
A)Sequence diagrams are graphically represented in the form of a table in which
objects arranged along X axis and messages ordered in increasing time along the
Y-axis
3)How objects are placed?(at the top of your diagram, across X-axis)
A)Here we place the objects that participate in the interaction at the top of your
diagram , across the X-axis ,
4)Placing the initiating objects?(at left and subordinate objects to right)
A)we place the objects that initiates the interaction at the left, and increasing more
subordinate objects to the right
5)Placing the messages?(along Y axis in order of increasing time from top to
bottom)
A)We place the messages that these objects send and receive along the Y axis , in
order of increasing time from top to bottom
6)Sequence Diagram
7)How to differentiate sequence diagrams from collaboration diagrams?
(objects life line, focus of control)
A)Sequence diagrams have two features that distinguish them from collaboration
diagrams first object life line ,second focus of control
8)What is object lifeline?(a vertical dashed line representing existence of object)

10
A)First there is the object lifeline which is a vertical dashed line that represents the
existence of an object over a period of time

9)What is the focus of control?( that shows period of time during which object is
performing an action)
A)Focus of control is a "thin rectangle" that shows the period of time during which
an object is performing an action, either directly or through a subordinate
procedure.

Collaboration Diagrams

11
12

You might also like