using Quick Sequence Diagram Editor for sequence diagrams

Posted by Jason S on Stack Overflow See other posts from Stack Overflow or by Jason S
Published on 2009-12-04T22:33:10Z Indexed on 2010/05/27 9:41 UTC
Read the original article Hit count: 765

Filed under:

Anyone have experience with Quick Sequence Diagram Editor? The combination of instant display + text source code + Java implementation is very attractive to me, but I can't quite figure out how to make the syntax do what I want, and the documentation's not very clear. Here's a contrived example:

al:Actor
bill:Actor
atm:ATM[a]
bank:Bank[a]

al:atm.give me $10
atm:al has $3=bank.check al's account balance
al:atm.what time is it
atm:al.it's now
atm:al.stop bugging me
atm:al.you only have $3
atm:bill.and don't you open your mouth
bill:atm.who asked you?
bill:atm.give me $20
al:atm.hey, I'm not finished!
atm:bill has $765=bank.check bill's account balance
atm:yes I'm sure, bill has $765=bank.hmm are you sure?
atm:bill.here's $20, now go away
atm:great, he's a cool dude=bank.I just gave Bill $20
al:atm.what about my $10?
atm:al.read my lips: you only have $3

Here's the result from QSDE in single-threaded mode:

single-threaded

and in multi-threaded mode:

multi-threaded

I guess I'm not clear what starts/ends those vertical bars. I have a situation which is single-threaded, but there's state involved, and all the messages are asynchronous. I guess that means I should use an external object to represent that state and its lifetime. What I want is for one timeline to represent the message sequence

  1. al:atm.give me $10
  2. atm:bank.check al's account balance
  3. bank:atm.al has $3
  4. atm:al.you only have $3

and another timeline to represent the message sequence

  1. bill:atm.give me $20
  2. atm:bank.check bill's account balance
  3. bank:atm.bill has $765
  4. atm:bank.hmm are you sure?
  5. bank:atm.yes I'm sure, bill has $765
  6. atm:bill.here's $20, now go away
  7. atm:bank.I just gave Bill $20
  8. bank:atm.great, he's a cool dude

with the other "wisecracks" representing other miscellaneous messages that I don't care about right now.

Is there a way to do this with QSDE?

© Stack Overflow or respective owner

Related posts about sequence-diagram