Book a Demo

Author Topic: Duration constraint in seq. diagram - how?  (Read 6810 times)

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Duration constraint in seq. diagram - how?
« on: September 22, 2004, 08:04:28 am »
Hi

I want to add a duration constraint to a sequence diagram that specifies the maximum time that must pass between object1 sends a message to object2 until object2 replies with a message to object1.

The kind of duration I want to show is this


This example was taken from the UML 2.0 Superstructure spec, Chapter 14.4, Table 14, "Duration constraint".

Does anyone know how to do this in EA. Does EA even support this UML 2.0 feature?

Thanks in advance.

Mikkel

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Duration constraint in seq. diagram - how?
« Reply #1 on: September 22, 2004, 04:24:55 pm »
Select one of the messages, open context menu and select Attach Note or Constraint. Check both message tick boxes and the Constraint radio button.
Click OK and voila you have a constraint box linked to both messages.
Not exactly the same representation as you drew, but in fact its IMO more flexible in that the specific messages are linked.
hth
Bruce

p.s. what I'd like to see is how you model what happens when the maximum is exceeded. We are looking at a lot of stateless subsystems here, some of which shut-up-shop now and then leaving unsatisfied requests.  Since the server object (system) will never respond to another message what we want to show is an exception message being thown from the constraint not being satisfied.  Would love to see if you have a messaging pattern that addresses this as we are struggling....
« Last Edit: September 23, 2004, 12:25:08 am by sargasso »
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: Duration constraint in seq. diagram - how?
« Reply #2 on: September 23, 2004, 01:23:10 am »
Hi Bruce,

Thanks for your reply. The constraint note is also the solution I am using so far, but I would really like the other representation because I think it clutters up the diagram less. I already have a lot of notes on it.

In my case, the sequence diagram specifies requirements, that is the constraint MUST be met (in hard real time systems we can work with constraints like that). The constraint in this case will be implemented in the class that is required to respond. When it starts executing, it will set up an OS timer. If it does not finish what it is doing within the given time, it will receive a timer event and the respond regardless.

I think I would model what you are talking about with an "alt" interaction fragment with one part showing the normal flow and the other showing a timer message arriving (depending on your implementation) and whatever consequences that should have. You might show the exception handling on another diagram and insert it as a diagram reference (drag the diagram onto the sequence diagram).

Best regards,
Mikkel