Skip to main content

Sequence Diagram: DSL or not DSL ?

I had to produce some UML Sequence Diagram and I tested some Graphical and command line tools.
With UML tools there are 3 possibilities (sometimes mixed in a single application):

  • Draw your diagram (UMLet, ArgoUML, Violet ...)
  • Reverse engineer your code. It can work for Class Diagram, but the result for Sequence Diagram is generally unusable. (ArgoUML ...)
  • Describe your diagram in a DSL (PlantUML, UMLGraph, ...)
There is no "Best Option" since it depends on your use case:
  • for quickly puting an idea on paper, I like UMLet very much for Class, Component ... But I have to admit that VioletUML is way better for Sequences ! 
  • When I want to keep my diagram in sync with the code and documentation. The DSL/Reverse Engineering approach allow me to put the diagram description in the JavaDoc. The setup in the Maven POM file (with UMLGraph, should be possible with PlantUML too).
  • I never have the case where a DSL would be that useful. But you just got all the benefits of text files obviously: diff, grep ... and some tools allow you to embed your description in Wiki, LaTex, Word ... (PlantUML).


I tested several DSL:

I have to admit that I am a bit deceived with the current state of DSL for Sequence Diagram.

  • They are not that obvious. The easiest is "Client -> Server : HTTP request" with PlantUML. But with SDEdit you would read: "Client:Server.HTTP request" !?
  • They could do more (like automatically activating the lifeline upon message reception). With PlantUML you pollute your description with numerous "Activate Server" ; "Deactivate Client" ...
  • They quickly becomes hard to read and maintain. Two main problems:
    • If you send a message at the beginning and got the response at the end. The message/response link is lost in the distance introduced by all the dialogs in between. You can use indentation, but it is up to you, not a DSL feature.
    • When you have parallel executions or interlinked messages, even the indentation won't be a solution. I don't even see how it could be solved.
  • You really need to see the resulting diagram as you type, if you don't want to end with a lot of rework.
  • The tools I used didn't show you the result "out of the box". You have to setup some schell scripts or other tools. (SDEdit being the exception.)
I think that it is not an inherent problem with DSL. But we didn't find a suitable DSL for Sequence Diagrams and an intelligent application that would really understand Sequence Diagram, and not just describe lines with labels. This would introduce more constraints. There are certainly things that we wouldn't be able to describe as we want, but it should solve 80% of the cases hopefully.

Comments

I use a uml modeling tool called as creately. Its Online and a platform independent software to draw uml sequence diagrams. What is the software you use to draw sequence diagrams ?

Popular posts from this blog

VirtualBox, CentOS, Network and Template

I have been working with VirtualBox and CentOS recently, here are some notes about this experience.
I used VirtualBox 4.2 and CentOS 6.3, but most of this should work with other products too. I created the first headless, minimal CentOS via NetInstall.
I cover two points: create a template machine and configure the Network.
Configure the NetworkWe want Internet access and a LAN local to the host.
For background information read: Networking in VirtualBox by Fat Bloke on June 2012.
The easiest is to enable two Network Adapters: One will be "Host-only" and the second "Nat". In the "Preference" menu you can see the DHCP server range for the Host-only Network. So you may set fixed addresses outside this range.
Next: start the guest. There may be various results at first, depending on a lot of things. Some problem might be solved by rm -f /etc/udev/rules.d/70-persistent-net.rules and a reboot.
Anyway, configure the two interfaces (set your own IP and MAC addresses)…

One in six IT projects ends up ‘out of control’

http://www.ox.ac.uk/media/news_stories/2011/110822_1.html

A surprisingly high number of projects are 'ticking time bombs', according to researchers at the University of Oxford. They analysed 1,500 global projects that had revamped their information technology systems within the last 10 years. They discovered that one in six projects in the sample went over budget by an average of 200 per cent (in real terms) or over ran by an average of almost 70 per cent.

Their conclusion is similar to previous studies: http://brunovernay.blogspot.com/2009/10/excellent-studies-on-software-quality.html