Book a Demo

Author Topic: Signals in sequence diagrams  (Read 6488 times)

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
Signals in sequence diagrams
« on: December 03, 2007, 02:09:17 pm »
It appears that, in order to reuse a signal name in a sequence diagram, it must be an operation associated with the receiving object.  The UML Superstructure Spec says "A signal is defined
independently of the classifiers handling the signal occurrence".  

My implementation of signals uses a message class.  All messages are received by the target object with the same operation (DoEvent).  It would be nice to have a list of reusable signals to choose from as well as a list of operations.

Make sense?

revdev
re-Vision Development

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Signals in sequence diagrams
« Reply #1 on: December 03, 2007, 04:20:04 pm »
revdev,

I wonder if you are talking about two facets of the same thing. Think of the signal as the throwing of an event. There still has to be (zero or more) 'targets' for the event. Each of these will implement (or subscribe to, or whatever) some method that is activated when the event is received. This event is the operation referred to in UML.

As to your message class, I suspect this is either a parameter that would be passed through the event and receipt paradigm (it might be a parameter of the receiving operation). Or, it might be something along the lines of a delegate in .Net, or some such.

If this rambling makes any sense at all, you should be able to set up some kind of reusable set 'things' that will satisfy your requirement. Whether you do this through inheritance, interfaces, or something else (in whatever combination), you can decide based on the specifics of your situation.

HTH, David
No, you can't have it!

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
Re: Signals in sequence diagrams
« Reply #2 on: December 04, 2007, 04:37:15 am »
I do have my collection of messages, but I really want to apply a name to the message from the toolbar in the interaction diagram.  The only way I see to do this is if the name is an operation belonging to the target class.
re-Vision Development

gpc

  • EA User
  • **
  • Posts: 111
  • Karma: +0/-0
    • View Profile
Re: Signals in sequence diagrams
« Reply #3 on: December 04, 2007, 05:05:46 am »
Hi revdev,
If you're only talking about a single signal or two, then it isn't a great hardship to define that signal for any targets that will use it. If you're looking at a whole range of signals used by multiple targets, then EA doesn't support a 'global' list as such. The only way to handle this is to maybe define a message handler class and derive your targets from that?
How do you intend to implement? Will you create the same function for all targets? if so, then it makes sense to do the same thing in EA.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Signals in sequence diagrams
« Reply #4 on: December 04, 2007, 02:25:59 pm »
Hi revdev,

Look up "Reception" in the UML Superstructure, section 13.3.23.

Quote: "A reception is a declaration stating that a classifier is prepared to react to the receipt of a signal."

Quote 2: "Receptions are shown using the same notation as for operations with the keyword «signal»"

Define Receptions the same as Operations, give them the keyword «signal» and use them in sequence diagrams.

HTH
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Signals in sequence diagrams
« Reply #5 on: December 04, 2007, 04:18:33 pm »
Thanks Neil,

It felt like I was missing something there, since I knew EA handled this situation. Still, the feature space is big enough that it's easy to forget some of the pieces.

David
No, you can't have it!

gpc

  • EA User
  • **
  • Posts: 111
  • Karma: +0/-0
    • View Profile
Re: Signals in sequence diagrams
« Reply #6 on: December 04, 2007, 04:48:34 pm »
Just a word of warning here. There is a bug in 818 where specifying a signal as a stereotype for a "message" causes it to be additionally specified as a condition each time the package is loaded. this may/probably is only a problem if your importing/exporting packages or using version control (which effectively does this). sparx are aware and will hopefully have a fix in 819 (please!) ?

thomaskilian

  • Guest
Re: Signals in sequence diagrams
« Reply #7 on: December 05, 2007, 02:42:41 am »
Can you please send an official bug report. Thanks!

gpc

  • EA User
  • **
  • Posts: 111
  • Karma: +0/-0
    • View Profile
Re: Signals in sequence diagrams
« Reply #8 on: December 05, 2007, 03:14:52 am »
Already done and reproduced by Sparx - awaiting fix.

thomaskilian

  • Guest
Re: Signals in sequence diagrams
« Reply #9 on: December 05, 2007, 03:25:42 am »
Oops. I should read more carefully. You already said it :-[