Book a Demo

Author Topic: Bug regarding the way messages are drawn?  (Read 3558 times)

jps

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Bug regarding the way messages are drawn?
« on: September 29, 2006, 03:07:32 pm »
In build 798 (and in 797) when creating a message between two lifelines, on either a sequence or communication diagram, the message is displayed as:

message(parameter) :returnValue

Instead of as:

returnValue := message(parameter).

Yes, I've double and triple-checked that I am specifying the Return Value in the proper place on the Message Properties dialog.

This isn't correct... is it?

Thanks!
« Last Edit: September 29, 2006, 03:09:47 pm by jps »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Bug regarding the way messages are drawn?
« Reply #1 on: September 29, 2006, 04:04:22 pm »
It looks like EA is 'lifting' the syntax from a class diagram. That said I must confess that I don't know what the UML 2.1 spec says about this.

Anyone know the relevant section?
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Bug regarding the way messages are drawn?
« Reply #2 on: September 29, 2006, 04:57:06 pm »
Quote
It looks like EA is 'lifting' the syntax from a class diagram. That said I must confess that I don't know what the UML 2.1 spec says about this.

Anyone know the relevant section?
The [size=13]UML 2.1 Superstructure (interim)[/size] Specification, section 14.3.20 Message (from BasicInteractions) says:

Syntax for the Message name is the following:

<messageident> ::= ([<attribute> ‘=’] <signal-or-operation-name> [‘(‘ [<argument> [‘,’<argument>]* ‘)’] [‘:’ <return-value>]) | ‘*’

So EA is following the Specification here...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jps

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Bug regarding the way messages are drawn?
« Reply #3 on: September 30, 2006, 07:00:03 am »
Cool, Paolo, thanks for the reference.

If I'm reading the spec correctly then what I'm looking for is "messageident", the return value seems to indicate the actual value that will be returned and placed into the variable specified in "messageident".

From the spec, pg. 512:


<messageident> ::= ([<attribute> ‘=’] <signal-or-operation-name> [‘(‘ [<argument>[‘,’<argument>]* ‘)’] [‘:’ <return-value>]) | ‘*’


I can't seem to find the definition of "messageident" anywhere in the spec... but based on this example on the same page I'm inferring that messageident is what I want.


v=mymsg(16, variab):96  // this is a reply message carrying the return value 96 assigning it to v


I've been able to accomplish this in EA by putting my variable name in the "Assign To" combo box on the Message Properties dialog.  I've also discovered that if I define any instance variables on the class of the sender's lifeline then I can simply select them from the "Assign To" combo box.

In any case, I can't find this (specifically the meaning/use of "Assign To" or "Return Value") documented in the EA documentation.  If its there, would anyone mind pointing me in the right direction?

Thanks,

James

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Bug regarding the way messages are drawn?
« Reply #4 on: September 30, 2006, 07:54:57 am »
Quote
Cool, Paolo, thanks for the reference.

If I'm reading the spec correctly then what I'm looking for is "messageident", the return value seems to indicate the actual value that will be returned and placed into the variable specified in "messageident".

From the spec, pg. 512:


<messageident> ::= ([<attribute> ‘=’] <signal-or-operation-name> [‘(‘ [<argument>[‘,’<argument>]* ‘)’] [‘:’ <return-value>]) | ‘*’


I can't seem to find the definition of "messageident" anywhere in the spec... but based on this example on the same page I'm inferring that messageident is what I want.


v=mymsg(16, variab):96  // this is a reply message carrying the return value 96 assigning it to v


I've been able to accomplish this in EA by putting my variable name in the "Assign To" combo box on the Message Properties dialog.  I've also discovered that if I define any instance variables on the class of the sender's lifeline then I can simply select them from the "Assign To" combo box.

In any case, I can't find this (specifically the meaning/use of "Assign To" or "Return Value") documented in the EA documentation.  If its there, would anyone mind pointing me in the right direction?

Thanks,

James
You're welcome James...

As to your questions, I think you find that the statement you quote is an example of EBNF (Extended Backus-Naur Form) - depicting the syntax of a messageident.  As is typical with developer type people, they have overly contracted the name and thereby lost clarity.

What that phrase is saying is that a message can be identified by its explicit signature.  The signature is spelt out on the right of the ::=

Thus, notwithstanding that you may call the same method with the same arguments, if you place the result in a different attribute, it's a different message.

In the case of EA, the Assign To defines if there is an attribute into which to place the return value.  This can be empty.

The Return Value is actually the Return Value Type (if you select an operation from the operation button you can select one of the defined operations of the target Class and these values will be filled in for you)

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!