Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

self message(non recursive) vs self recursive message

Tags:

What is the difference of these two messages? I searched the web a bit and most what I could find is

A self message is a message that an object sends to itself. It is a message that represents the invocation of message of the same lifeline. A self message can represent a recursive call of an operation, or one method calling another method belonging to the same object.

What is the benefit of additional activation bar that recursive message brings?

In graphical notation:

non recursive self message:

enter image description here

recursive self message

enter image description here

what is the difference?

like image 316
michael nesterenko Avatar asked Jul 24 '12 07:07

michael nesterenko


People also ask

What is a recursive message?

Recursive Message A message defines a particular communication between Lifelines of an Interaction. Recursive message is a kind of message that represents the invocation of message of the same lifeline. It's target points to an activation on top of the activation where the message was invoked from.

What are different types of messages in sequence diagram?

A message in a UML sequence diagram specifies the kind of communication, and the sender and receiver. Messages can be named freely. Depending on the type of action the message represents, a message can be of the following sort: synchronous call, asynchronous call, asynchronous signal, or reply.

What is self message in sequence diagram?

A Self-Message reflects a new process or method invoked within the calling lifeline's operation. It is a specification of a Message, typically in a Sequence diagram. Self-Message Calls indicate a nested invocation; new activation levels are added with each Call.

What is return message in sequence diagram?

Return Message Represented on a diagram by a dashed line with a filled arrowhead. A return message is a message that returns from an object to which a message was previously sent. Return messages are valid only from synchronous messages, and are themselves synchronous.


1 Answers

You should use a self message when you are calling functions in the class which either don't call other functions, don't send any messages (or they do but you don't want to show this in the sequence).

If you also want to model how the inner functions of the class interact with other lifelines, you have to use recursive calls to show this, otherwise the reader can't know that the messages are sent/received from the inner function.

like image 86
vainolo Avatar answered Sep 21 '22 06:09

vainolo