Q2 An activation bar represents
the lifetime of an object
the time from when an object
receives a message to when it sends a message
the time during with the
object is the one performing computation
the time from when an object
receives a message to when it sends a reply to that message
Q3 The order of lifelines from left to right represents:
the order in which objects
send messages
the order in which objects
were created
nothing except how the
modeller found it convenient to draw them
the order of importance of
the objects
Q4 Consider (and sketch on a piece of paper, or at least imagine
doing so) a simple sequence diagram in which the messages and
returns, in time order, are: (1) an actor sends m() to a; (2) a sends p() to
b; (3) c sends q() to b; (4) b replies to q(); (5) b replies to p(); (6) a
replies to m(). Is this legal and sensible?
No, because nothing
causes q()
No, because nothing
should happen in between a message and the reply to it
Yes
Yes, provided c doesn't
have the same class as a
Answers:
Q1: top to bottom
Q2: the time from when an object receives a message to when it sends a reply to that message
Q3: nothing except how the modeller found it convenient to draw them (typically, a sequence is started by a message from an actor which is placed on the left, and the next objects involved are then drawn from left to right, but it does not have to be done this way.)
Q4: No, because nothing causes q(). (Students often draw this kind of thing, though. Make sure you always understand what causes what. NB you can use UML sequence diagrams to represent concurrent behaviour in which this kind of thing can happen, but in a sequence diagram there would still have to be a cause for q() e.g. a message from an actor or a found message.)
If in doubt, review.