I find the
sequence diagram to be one of the most useful UML diagrams - but it's also one of the most fiddly & annoying to generate in a diagramming tool. There's a few reasons for that:
- there's a large amount of implicit structure which is tedious to maintain
- sequence diagrams quickly get complex for processes with lots of actors and/or actions
- I can never remember all the conventions for representing concepts like alternation, loops and nesting
Luckily, the web to the rescue! The
websequencediagrams website has a on-line diagram generator which uses a simple language to describe the diagram. This works well precisely
because of the structure in sequence diagrams. Because they are inherently linear in structure, they are more constrained than other UML diagrams.
The language supports just about everything you might want - signal types, groups, nesting, notes, lifelines, etc. It outputs in images or as PDF - and it even has cool styles! Here's the idea:
loop 1000 times
Me->Visio: draw sequence diagram
Visio->Me: frustration
end
Me->Google: search for better way
Google->Me: find websequencediagram tool
Me->WebSequenceDiagram: draw sequence diagram
WebSequenceDiagram->Me: happiness!
produces
I've blogged about the appeal of specifying UML diagrams using code
before. I'm not sure how much traction TextUML is getting - but it's hard to resist the appeal of a web interface, a simple language, and sexy ouput.
Now, if only someone would develop a force-directed web-based
state diagram engine...
Note: there's some other alternatives to the websequencediagram tool - the author blogs about them
here. The most interesting from my point of view is
sdedit, which is open-source and Java-based. It's more powerful, but the language looks a mite complex. (Too bad there's no standard language for describing UML - maybe the Three Amigos should skip a siesta and whip one up.)