Book a Demo

Author Topic: message as return in sequence diagrams  (Read 7893 times)

rabra

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
message as return in sequence diagrams
« on: January 24, 2008, 02:03:34 am »
Hallo,

I try to show the way my C# code works in a sequence diagram. I have the possibility to call a method in another class(lifeline) or the one calling. Also I have the possibility to show returns.

In one case, one method in a class calls another method in the same class. No problem. But is there a possibility to put a return message from method 2 to method 1?

(I use EA 7.0.816)

Rabra

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: message as return in sequence diagrams
« Reply #1 on: January 24, 2008, 07:43:01 am »
I'm not sure it would be correct sequence diagram (and that I understan you).
A method belongs to an object, it doan't exist by its self (though technicly speking it does have it own actual instance in run time), thus you can't send returned values to the method.
Also - how would you "draw" it?
Recursion definition:
If you don’t understand the definition read "Recursion definition".

rabra

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: message as return in sequence diagrams
« Reply #2 on: January 25, 2008, 12:16:06 am »
Well, what I want to show is something like 'here starts the method, something happens and here it is finished with this return value'.
But perhaps the sequence diagram is not the proper place to show something like that?
So the right way to use a sequence diagram is only showing the calls (that themselves point out the return values)?
But what would you propose to use instead?

rabra

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: message as return in sequence diagrams
« Reply #3 on: January 25, 2008, 04:23:58 am »
What about Tools | Options | Diagram | Sequence | Assume message returns. AFAIK the default is checked (which is recommended in the documentation). What happens if you clear this option? Note that you might have to draw a new sequence, as the effect might not be retroactive.

Please let us know.

David
No, you can't have it!

rabra

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: message as return in sequence diagrams
« Reply #4 on: January 28, 2008, 01:50:09 am »
That really works. But only with a little trick:
If I call a method (method1) within the same class (Lifeline) and want to show the return value
AND
from within this method (method1) I call a method in another class (method2),showing the return,
I have first to clear the 'assume message returns' options, then draw the return of method1, then the one of method2. The other way round it did not work.

So many thanks.
Rabra