Signal/slot connection in sequence diagram

Hi all, I would like to ask about performing component-to-component connection in a sequence diagram.
Scenario:

  • component_A has an interface with A_slot() method
  • component_B has an interface with B_slot() and B_signal() methods

Connecting slots is easy: just drag from component_A to component_B, select “message” in the appearing pop-up, component_B method list will appear (since component_B is the receiver), choose the B_slot() method.
vp
Same to connect from component_B to component_A, where component_B invokes the A_slot() component_A method, since component_A is the receiver

So far, so good, 100% clear.

My question is: how to deal with signals? In my example B_signal() belongs to component_B interface and, as a signal, it “emits” data (the red arrow) to whatever component was registered to receive such signalling.
How can I represent it in a VP sequence diagram? The data flow is truly from component_B to component_A, so I would like to see an arrow pointing to the left, like the red one in the picture.
But how can I choose among the list of component_B methods, if I am dragging from component_B to component_A?
Note that dragging from component_A to component_B is not suitable, since component_A doesn’t truly perform any call to component_B: component_A is just informed about incoming signal from component_B

Hi Enzo,

Thank you for your post. First of all, the red arrow should be correct. About the message to invoke, I am not sure if I am misunderstanding your case… If the signal as emitted like throwing an event, there still has to be a target for the event, which implements the logic to be performed upon the receipt of signal. So the ‘target’ is the operation to be chosen here. Am I right? Please correct me if I am wrong.

Best regards,
Jick Yeung

Hi Jick, thanks for your reply.

If the signal as emitted like throwing an event, there still has to be a target for the event, which implements the logic to be performed upon the receipt of signal.

Yes, it’s tricky to explain, but I try:

  • consider data flow is from B to A
  • consider component_B as the emitter of this signal “S” carrying data, which is exposed to the world
  • consider component_A as the designed receiver, in its slot “SLOT”
  • moreover, consider component_A knows/sees/includes the interface of component_B, including the signal “S”.

In a signal/slot world, component_A, normally on init, does this:
Connect(component_B,SIGNAL(“S”),this,SLOT(“SLOT”));
which in pretty words means: “dear component_A, every time you will see the signal “S” coming from component_B, call your own slot “SLOT”

So, component_B doesn’t know anything about existence of “SLOT” in component_A, it even doesn’t know component_A!
Only component_A knows component_B and its signal “S”, as it is in the component_B exposed interface

This is why, when drawing the red arrow from B to A, the “SLOT” cannot be present in component_A method list which is shown on dragging: because this “SLOT” is not exposed to component_B!

That’s exactly what I am asking: a “reverse” way, on dragging, to choose among the sender list, rather then among the receiver list.
That is, I would like to choose the “S” when dragging arrow from B to A, even if, in this particular case, “S” belongs to B (the sender) and not to A (the receiver)

I hope now is more clear.