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:
recursive self message
what is the difference?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With