Book a Demo

Author Topic: Self Messages in Sequence Diagrams  (Read 9913 times)

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Self Messages in Sequence Diagrams
« on: March 29, 2004, 08:53:00 am »
Hi,

I've (again) a question.

Is it possible to create sometring like that with EA?:


+---------+
|   :A    |
+----+----+
    |
   +++ --------+
   |#|         | MySelfMessage
   |#+-+ <-----+
   |#|#|
   |#|#|
   |#|#|
   |#|-+- - - -
   |#|         | Result = MySelfMessage
   +++ <- - - -
    |
    |
    |


(Nice Ascii-art, isn't it?)  ::)

My Problem is to create the return-Message. Either I get a Message from the current activation level to a new one, or EA end's the current and creates a new self message from the first activation level.

But it's not possible for me to end the current activation level, and send a return.

I hope it's clear, what is my problem.

bye
Andreas
« Last Edit: March 29, 2004, 09:01:50 am by glaubitz »
bye
Andreas

thomaskilian

  • Guest
Re: Self Messages in Sequence Diagrams
« Reply #1 on: March 30, 2004, 01:48:18 am »
Andreas,
maybe I'm wrong, but isn't it that you have to put a 2nd :A object at the right hand side. What you have drawn simply looks like an "internal procedure call".

Cheers,

Thomas

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: Self Messages in Sequence Diagrams
« Reply #2 on: March 30, 2004, 02:15:27 am »
Hi Thomas,

thanks for your answer.

You're right. What i want to show is a "internal procedure call".

Putting a second :A Object to the Diagramm would be completly wrong. Because MySelfMessage should be a message to the same instance of :A object.

To draw the Message is not the problem. That is correct. The Problem is the Answer.

EA all the time produce me something wrong like that:


+---------+
|   :A    |
+----+----+
    |
   +++ --------+
   |#|                                            | MySelfMessage
   |#+-+ <-----+
   |#|#|
   |#|#| - - - -
   |#|#|                                      | MySelfMessage : Result
   |#|#+-+<- - -
   |#|#|#|
   |#|#|#|
   +-+-+-+    
    |
    |
    |


:(

I hope now it's a bit easier to understand

bye
Andreas
bye
Andreas

thomaskilian

  • Guest
Re: Self Messages in Sequence Diagrams
« Reply #3 on: March 30, 2004, 03:22:01 am »
Andreas,
again I may be wrong, but messages are intended to be exchanged between (different) object instances. A procedure call is nothing that should appear on a sequence diagram - although it is quite often used that way.

Algorithmic documentation is something you can discuss about  ;D I like meta languages that make use of a more abstract view of the algorithm. One should be able to comprehend the semantics by reading a paragraph not longer than half a page. All kinds of diagrams (Nassi-Shneiderman, "abuse" of sequence diagrams, etc.) won't do the job - my opinion.

Cheers,

Thomas

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Self Messages in Sequence Diagrams
« Reply #4 on: March 30, 2004, 05:33:22 am »
Thomas,

Would you boil things out in an activity diagram - or possibly a statechart, sorry State Machine diagram.

Or do you have something else up your sleeve for interesting algorithm documentation?

Stephen

thomaskilian

  • Guest
Re: Self Messages in Sequence Diagrams
« Reply #5 on: March 30, 2004, 11:22:40 pm »
Stephen,
like everything it depends... Honestly speaking I do not make much use of Activity, Statechart and whatever diagrams. This for the simple reason that in most cases it is easier and faster to describe things verbally than graphically.  Furtheron the intended reader of the documentation should not be forgotten. Does he really need to understand each detail or is it enough to give him an overview? Some guys love graphics others don't. Again: it depends  ;) There is really no recipe for good documentation.

Cheers,  Thomas

Erik Finnegan

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Self Messages in Sequence Diagrams
« Reply #6 on: March 31, 2004, 12:47:25 pm »
Andreas,

what you are trying to do is no possible program. Be the procedure call internal or directed to another object, it ALWAYS adds a method call to the stack - and that's what the new layer of activation means. Thus, if you're calling an internal function to set a value, it DOES add a new call the method stack.

If you want to model a return value, use the appropriate field in the message properties ("return" value in the "signature" frame). It will apear like that


+---------+
|   :A    |
+----+----+
    |
   +++ --------+
   |#|         | result := MySelfMessage
   |#+-+ <-----+
   |#|#|
   |#|-+
   |#|
   +++
    |
    |



Regards,
Erik

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: Self Messages in Sequence Diagrams
« Reply #7 on: April 01, 2004, 03:21:27 am »
Hi Erik,

I beg to differ.

I've a done look to the UML2 Specification at http://www.omg.org/docs/ptc/03-08-02.pdf.

And in chapter 14.3.14 is written:
Quote
..."If the Message represents a CallAction, There will normally be a return message from the called lifeline back to the
calling lifeline before the calling Lifeline will proceed."...

(At the end of page 429).

And at the next page:
Quote
..."Synchronous Messages typically represent method calls and are shown with a filled arrow head. The reply message from
a method has a dashed line."...

And then there is a section that is in conflict to your statement.
Quote
..."Return-value and attribute assignment are used only for reply messages. Attribute assignment is a shorthand for including
the Action that assigns the return-value to that attribute. This holds both for the possible return value of the message (the
return value of the associated operation), and the out values of (in)out parameters."...


May be I'm wrong (my english is not the best one), but for me there is written, that procedure calls should have a return message, and the return value IS NOT written directly to the call itself. And in my oppinion return messages shouldn't create a new activation. Far from it: The should end the current!

Regards,
Andreas
bye
Andreas

thomaskilian

  • Guest
Re: Self Messages in Sequence Diagrams
« Reply #8 on: April 01, 2004, 04:09:46 am »
Hi Andreas,
I think I got your point (How the hell can I place a picture here easily???)  If you make a self message for an object you are not able to also place the return message from this instance - you can only choose between being a "Is Return" or not. Am I right? Probably the only way to do this is like Eric described it above and the "Is Return" message is both of it...

Cheers, Thomas
« Last Edit: April 01, 2004, 04:17:24 am by thomaskilian »

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: Self Messages in Sequence Diagrams
« Reply #9 on: April 01, 2004, 09:02:33 am »
Hi Thomas,

OT: I think putting pictures to an posting is not possible without having it someware in the web.  :( But thats an other story. You don't like ascii-art... hehe

Back to the topic:

I think you are right. But this is a problem of EA (Bug?! ) . Because in the UML it is allowed.

Where is the guy I have to hit?!  ;)

Regards,
Andreas
bye
Andreas

vidafo

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Self Messages in Sequence Diagrams
« Reply #10 on: April 02, 2004, 03:12:14 am »
Hi Andreas
Not a solution just an opinion. Too many lines and arrows can make a diagram unreadable. So "return" Arrows I would only use if they have an absolutly significant meaning.

UML gives you the joice to use an explicit return arrow or indicate the return value by using it as part of the message as implemented in EA.

A tool is a tool and it's the implementers freedom to provide certain functionality or not. So do not hit anybody having his freedom. Ask them for more functionality.
Daniele

javelin5

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
This is the better question to ask...
« Reply #11 on: April 05, 2004, 12:22:55 pm »
I actually ran into this.  We had to just say that in a self procedure call there is no way in a sequence diagram to show what has occurred.

The better question is this:  How do you represent this in any UML tool for a self call.

+---------+                  +----+----+
|   :A    |                     |     :B     |
+----+----+                 +----+----+
    |                                   |
   +++ --------+                 |
   |#|         | MySelfM...      |
   |#+-+ <-----+                |
   |#|#|                             |
   |#|#| -------------------->+
   |#|#|                             | otherClassMessage
   |#|#|<---------------------+
   |#|-+- - - -  
   |#|         | Result = MySelfMessage
   +++ <- - - -
    |
    |
    |

This is what you can't do as far as I know.  It would have been very useful to be able to do this a couple of times.
Timothy F. Brown