Book a Demo

Author Topic: Difference between message and call in sequence diagram  (Read 24506 times)

aledmb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Difference between message and call in sequence diagram
« on: July 26, 2016, 08:50:16 am »
Hi everyone,

I read the documentation on these two elements, but I can't get my head around the concept of a call.

What would be the difference? When should I use one over the other?

Thanks in advance for your help!

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #1 on: July 26, 2016, 04:53:33 pm »
I assume you want to know the difference between call an signal.

Calls are always calling something e.g. a method in a class, or e.g. if you type something on your keyboard. Such a call can be synchronous (stop the world) or asynchronous (doing something else while waiting for response).
Signals are always asynchronous. If e.g. your PC gives you a beep or sound when booting is finished it is a signal, the PC is not calling a functionality you provide.
Best regards,

Peter Heintz

aledmb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #2 on: July 26, 2016, 09:27:17 pm »
I'm talking about the sequence diagram where you have two main options of elements for interaction.

One is called message (which I assume you're calling signal) and the other is called call.

Ok, but if that's the difference is only in being synchronous or asynchronous, why can I set both messages and calls to be sync/async?

They're no different in that respect to me.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #3 on: July 26, 2016, 09:34:52 pm »
It's about the same.  A call is synchronous and a message is asynchronous.

q.

aledmb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #4 on: July 26, 2016, 09:47:20 pm »
The docs say something about raising the activation level.

It's something to do with nesting messages and building a visual hierarchy, but I don't get it.  :-[

http://sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/call.html
http://www.sparxsystems.com/enterprise_architect_user_guide/8.0/modeling_languages/lifelineself_messagehierarch.html

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #5 on: July 26, 2016, 10:21:10 pm »
Well, a call can be recursive and you can raise the activation level (there's a little right arrow for a message beneath another one). A message of course can't because it is asynchronous.

q.

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #6 on: July 26, 2016, 10:24:43 pm »
Ok, now I might got you.
Let’s say you call a method in your class and within this method you call another method of your class, this is a “self message” extending the activation time of your “fist method call/first message”  because of your first method cannot end until your second method is finished. If you “call” within your fist method an method of another class it is quite the same and that is what EA calls a call.
Best regards,

Peter Heintz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #7 on: July 26, 2016, 10:33:10 pm »
I forgot: for asynchronous there is a difference between call and signal. The first performs a call in a separate thread (asynchronous/in parallel) while signal stands for using a semaphore.

q.

aledmb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #8 on: July 26, 2016, 11:57:28 pm »
Ok, now I might got you.
Let’s say you call a method in your class and within this method you call another method of your class, this is a “self message” extending the activation time of your “fist method call/first message”  because of your first method cannot end until your second method is finished. If you “call” within your fist method an method of another class it is quite the same and that is what EA calls a call.

Almost, and now maybe you will lose me completely. :D

When I call another method in my class (a self-message), it already extends the activation time of the caller, as long as the call is set to be synchronous.

My point is I don't see any difference (visually or in behavior) between "message" and "call".

aledmb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #9 on: July 26, 2016, 11:58:28 pm »
I forgot: for asynchronous there is a difference between call and signal. The first performs a call in a separate thread (asynchronous/in parallel) while signal stands for using a semaphore.

q.

Now that may be it, but I wouldn't be able to tell the difference, still.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #10 on: July 27, 2016, 12:17:43 am »
If you can't tell, just use synchronous call and forget about the rest.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #11 on: July 27, 2016, 09:14:24 am »
Is the question you're asking... "In the Interaction toolbox, there are relationships called Message and Call. They appear to create identical messages. How does EA treat them differently?" The only difference I can find is that Call will raise the activation level by one, if applicable.

To demonstrate, create three lifelines and turn off the "Assume right to left messages are Return" option. Then create Messages from (in this order) 1->2, 2->1, 1->2, 2->3, 3->2 and finally a Call from 2->3. You should see the second-level of activation extends from the target of Message 5 to the source of the Call, but not from the target of Message 2 to the source of Message 3.
The Sparx Team
[email protected]

aledmb

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Difference between message and call in sequence diagram
« Reply #12 on: July 27, 2016, 12:35:33 pm »
Is the question you're asking... "In the Interaction toolbox, there are relationships called Message and Call. They appear to create identical messages. How does EA treat them differently?" The only difference I can find is that Call will raise the activation level by one, if applicable.

To demonstrate, create three lifelines and turn off the "Assume right to left messages are Return" option. Then create Messages from (in this order) 1->2, 2->1, 1->2, 2->3, 3->2 and finally a Call from 2->3. You should see the second-level of activation extends from the target of Message 5 to the source of the Call, but not from the target of Message 2 to the source of Message 3.

Wow, I finally got it!

Thanks a lot KP! ;)