Author Topic: are "generic sequences" allowed in UML?  (Read 2389 times)

ngong

  • EA User
  • **
  • Posts: 227
  • Karma: +0/-2
    • View Profile
are "generic sequences" allowed in UML?
« on: July 14, 2014, 04:24:05 am »
I am not a specialist in reading superstructure, just a S/W architect in real projects. However, I wonder about the meaning of (I called them) "generic sequences" that I came accross several times:

I understand if a user sends an "add" meassage with a 1 and a 2 as parameters to an object of class "calculator", getting a 3 as a return.

But what does it mean - and I do see this really often - when a user sends an "add" message with two "integers" and get an "integer" as a return?

As there is no further constrain, sending the message "add(1,2)" and get a "4" as a return should be a valid example of that generic sequence. It does not violate add(integer,integer):integer, but obviously it is wrong.

Has someone or can point me to the right words whether such "generic sequences" are part of UML? Whether they are of more value than sketchy remarks (which imho should not appear in a precise technical specification - may be in a clearly marked and non-binding introduction)?

Hope for some enlightening response, Rolf.



Rolf

qwerty

  • EA Guru
  • *****
  • Posts: 12334
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: are "generic sequences" allowed in UML?
« Reply #1 on: July 14, 2014, 06:06:59 pm »
Usually you can express those things with OCL. EA can check OCL syntax but can not perform OCL to check the ULM model.

q.

ngong

  • EA User
  • **
  • Posts: 227
  • Karma: +0/-2
    • View Profile
Re: are "generic sequences" allowed in U
« Reply #2 on: July 16, 2014, 01:09:32 am »
Thank you Qwerty for the answer.
This is what I see very often: a message is really a range or set of messages.
I may shrink that set of messages by applying OCL. Many people do so. But what do they mean? "Any element message of this set of messages my apply!"? or "There is a messages in this set which is compliant with the shown sequence!"? Looking at the examples of Superstructure 2.4.1 chapter 14.3.18 you find "v=mymsg(16,variab):96". If it would be "v=mymsg(intin: integer,variab):integer" what would this tell us? "The sequence is valid regadless of the values of intin and the return value!"?
My question is: would "mymsg(intin: integer,variab: VariabType):integer" as a message in a Sequence diagram be valid UML?
« Last Edit: July 16, 2014, 01:11:46 am by ngong »
Rolf

qwerty

  • EA Guru
  • *****
  • Posts: 12334
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: are "generic sequences" allowed in U
« Reply #3 on: July 16, 2014, 07:27:10 pm »
Quote
My question is: would "mymsg(intin: integer,variab: VariabType):integer" as a message in a Sequence diagram be valid UML?
You can tell EA to show messages exactly this way (either with full signature, with types only or as message name only).

q.