text
stringlengths
16
313
They both involve a communicationfrom a sender to a receiver that passes information by value that the receiver usesto determine what to do.
A call can be considered a pattern of signals that involvesa send with an implicit return pointer argument that is later used to send a returnsignal to the caller.
A call can be modeled as two messages, a call message and alater return message.
At an implementation level, signals and calls have differentproperties and detailed behavior, so they are distinguished as UML elements.
The receipt of a signal may trigger a state machine transition for the receiver.
An operation may be implemented asa procedure body (method) that is invoked when a call arrives.
When execution ofthe procedure is complete, then the caller resumes control, with an optional returnvalue.
The transition can also supply a return valuefor the caller.
When the transition is complete, or immediately if the call eventdoes not trigger a transition, the caller resumes control.
A message includes an expression for a set of target objects.
The message is sentto each object in the set.
Unless specified otherwise (by a constraint), the messagesare sent concurrently to all the objects in the set.
This means that the execution or-der is completely arbitrary and could be parallel.
If messages must be sent in a par-ticular order, they should be sent within a loop.
In case of a call, the caller regainscontrol when all the calls have completed.
The time a message is sent or received may be represented by an expression onthe message name.
A message has a sender, a receiver, and an action.
Within an interaction, the sender is the classifier role that sends the message.
The receiver is the classifier role that receives the message.
The action is a call; asignal; a local operation on the sender; or a primitive action, such as a create or de-stroy.
The action includes a list of arguments, an expression for a set of receivers,and a reference to the operation or signal involved.
Within an interaction, messages are related by the predecessor-successor rela-tionship and the caller-called relationship.
The latter relationship is applicable toprocedural methods.
Each call adds a level of nesting to the sequence.
Within acall, messages are ordered sequentially, with the possibility of concurrent subse-quences.
The predecessor-successor (sequencing) relationship organizes the messages ofa thread into a linear sequence.
A message can have multiple predecessors or suc-cessors.
If two messages have a common predecessor and are not otherwise se-quenced, then they may be executed concurrently.
If a message has multiplepredecessors, it must wait until all of them complete.
Such a message is a synchro-nization point.
The caller-called (activator) relationship defines nested procedure structure.
The message that calls a procedure (using a call action) is the activator of all of themessages that make up the body of the called procedure.
Among themselves thecalled messages have a predecessor-successor relationship to establish their relativeorder (which may permit concurrency).
If a message is a call, then the caller is blocked until the called procedure com-pletes and returns.
The sequencing and activator relationships relate messages within the same in-teraction only.
The notation for sequence diagrams and collaboration diagrams is different.
On a sequence diagram, a message is shown as a solid arrow from the lifeline ofone object (the sender) to the lifeline of another object (the target).
If the arrow isperpendicular to the lifelines, the message transmission is regarded as instanta-neous or at least fast, compared with external messages.
If the arrow is slanted,then the message transmission is regarded as having duration, during which othermessages might be sent.
In case of a message from an object to itself, the arrowmay start and finish on the same lifeline.
The message arrows are arranged in se-quential order from top to bottom, vertically.
If two messages are concurrent, theirrelative order is not significant.
Usually message arrows are drawn horizontally, indicating theduration required to send the message is atomic—that is, it is brief compared withthe granularity of the interaction and that nothing else can “happen” during themessage transmission.
This is the correct assumption within many computers.
A branch is shown by multiple arrows leaving a single point, each la-beled by a guard condition.
Depending on whether the guard conditions are mu-tually exclusive, the construct may represent conditionality or concurrency.
An iteration marker indicates that the set of messages can occur multipletimes.
For a procedure, the continuation condition for the iteration may be speci-fied at the bottom of the iteration.
If there is concurrency, then some messages inthe diagram may be part of the iteration and others may be singly executed.
On a collaboration diagram, a message is shown as a small labeled arrow attachedto a path between the sender and the receiver objects.
The path is the one used toaccess the target object.
The arrow points along the path in the direction of the tar-get object.
The relative order of messages is shown by the sequence number portion ofthe message label.
The message arrow is labeled with the name of the message (operation or signalname) and its argument values.
The arrow may also be labeled with a sequencenumber to show the sequence of the message in the overall interaction.
Sequencenumbers may be omitted in sequence diagrams, in which the physical location ofthe arrow shows the relative sequence, but they are necessary in collaboration dia-grams.
Sequence numbers are useful on both kinds of diagrams for identifyingconcurrent threads of control.
The following arrowhead variations may be used to show vari-ous kinds of message control flow.
Procedure call or other nested flow of control.
The entirenested sequence is completed before the outer-levelsequence resumes.
May be used with ordinary procedurecalls.
May also be used with concurrently active objectswhen one of them sends a signal and waits for a nestedsequence of behavior to complete.
Each arrow shows the progression tothe next step in sequence.
In the case of nested proce-dures, this corresponds to a bottom-across scan of theleaves of the tree of actions.
Used instead of the stickarrowhead to show explicitly an asynchronous messagebetween two objects in a procedural sequence.
The return arrow may besuppressed as it is implicit at the end of an activation.
The label has the following syntax:
return-value-list :=opt message-name ( argumentlist, )
The label indicates the message sent, its arguments and return values, and thesequencing of the message within the larger interaction, including call nesting, it-eration, branching, concurrency, and synchronization.
In a collaboration, the predecessor is a comma-separated list of se-quence numbers followed by a slash (/).
The clause is omitted if the list is empty.
Each sequence-number is a sequence-expression without any recurrenceterms.
It must match the sequence-number of another message.
The meaning is that the message flow is not enabled until all the message flowswhose sequence numbers are listed have occurred (a thread can go beyond the re-quired message flow and the guard remains satisfied).
All the se-quence numbers with the same prefix form a sequence.
The numerical predecessoris the one in which the final term is one less.
In a sequence diagram the visual ordering determines the sequencing, and asynchronization is shown by the presence of multiple messages to the same objectbefore the object sends any messages of its own.
The sequence-expression is a dot-separated list of sequence-terms followed by a colon (‘:’).
Each term represents a level of procedural nestingwithin the overall interaction.
If all the control is concurrent, then nesting doesnot occur.
Each sequence-term has the following syntax.
The integer represents the sequential order of the message within the next higherlevel of procedural calling.
Messages that differ in one integer term are sequentiallyrelated at that level of nesting.
The name represents a concurrent thread of control.
Messages that differ in thefinal name are concurrent at that level of nesting.
All threads of control are equalwithin the nesting depth.
The recurrence represents conditional or iterative execution.
This representszero or more messages that are executed, depending on the conditions.
An iteration represents a sequence of messages at the given nesting depth.
The iteration-clause is meant to be expressed in pseudocode or an ac-tual programming language; UML does not prescribe its format.
An examplewould be: *[i := 1..n].
A condition represents a message whose execution is contingent on the truth ofthe condition clause.
An example would be: [x > y].
Note that a branch is notated the same as an iteration without a star.
One mightthink of it as an iteration restricted to a single occurrence.
The iteration notation assumes that the messages in the iteration will be exe-cuted sequentially.
There is also the possibility of executing them concurrently.
Note that in a nested control structure, the recurrence is not repeated at innerlevels.
Each level of structure specifies its own iteration within the enclosing con-text.
A signature is a string that indicates the name, arguments, and returnvalue of an operation, message, or signal.