simplest ways of drawing UML sequence diagrams

A picture says a 1000 words. This is quite true even of UML, the Unified Modeling Language that’s used as a diagrammatic representation of software artifacts. One of the key advantages of having a diagram is to convey a lot of ideas with a simple glance. Diagrams usually simplify one’s perspective, and can give a holistic view of the entire system where one may can instantly and intuitively see how different aspects are related.

For some engineers, career growth may mean getting into people management – leading bigger and bigger teams of people. There are some of us who like to stay rooted in technology, and even as an individual contributor, growth of course is still inevitable. Apart from being fun, it is a fundamental necessity to avoid the decay of stagnation.

In any case, one of the key areas we need to grow is in our ability to communicate ideas to others.

UML provides an effective means to help us do just that. The diagrammatic notation enables engineers to communicate aspects of the entire software lifecycle, and is intuitive enough to give even those unfamiliar with the notations a fairly good idea.

Sequence Diagrams are one of the types that depict a time based flow of events. Here’s a nice tutorial by IBM Developerworks, and another one on the agilemodeling site.

Long long ago I used to use Rational Rose, that was a pretty cool and intelligent tool to work with UML. This usually was purchased with a limited floating license, which meant that one of us on the network had to close it in case another one wanted to use it 🙂 Once it was taken over by IBM, an organisational policy discontinued its use. An alternative we had was Microsoft Visio. This was a very very far cry from the intelligence and flexibility offered by Rose, and our average quality of diagramatic representation deteriorated to convenient block diagrams. Visio did provide good templates and support for UML, but seemed to usually be completely out of sync with any kind of understanding of what I wanted to do and quite a few times I found myself fighting with it esp for Sequence diagrams with dragging the mouse around resulting in items elusively moving around! (I found that changing some of the default settings made things easier, more info on the arcane topic available on request)

Anyway currently I have a license for neither Rose nor Visio, so to create some sequence diagrams now, I needed to look for something new. As I’m short of time, before that I first gave Microsoft Word drawing a try (aaack even though I could find workarounds like grouping text boxes and making everything I need in one place, and kept making copies of them, this approach was still horrible!)

Then I tried umlet( heh heh almost sounds like Omlet 😉 ) This was an excellent piece of software, I particularly liked the Eclipse integration. The amazing thing about umlet is that it converts simple text into a sequence diagram. So, all the intelligence of putting in the arrows and objects and lines is built into the software 8)

But I got stuck with having no control of object lifelines. The diagrams could be exported as JPG, and I was almost prepared to get into jpg editing using something like Paint (ugh) but luckily found another tool on the net: Quick Sequence Diagram Editor (sdedit).

This was conceptually similar to Umlet, where we enter text and it generates the diagram. But this one was soooo amazingly cool and elegant, using it made me feel like I was literally falling in love all over again! What a lovely piece of software, it definitely saves me tons of time and effort, and especially provides a lot of maintenance and flexibility!

It could be added as an Eclipse plugin as well, I’m sure lots more people would benefit from that added convenience (just a thought, though its good enough for me right now as it is as a standalone).

Try out both these tools, and see which one you like. What follows are just some more details.

One roadblock I hit in sdedit was what seemed to be an inability to specify something that’s being returned – but after a while looking closer at the comprehensive example, it turned out I could use an = sign to display that text. Another problem was that export to JPG resulted in a red tinge (I even tried to explicitly set a white background going to options while exporting, still same output). But export to GIF was perfect (white background). Calling a self-message is forcing an additional return value that comes at the end.

When I’d compromised on that minor annoyance and settled down for this one, I was about to close my umlet window when I suddenly figured out the reason for the lifelines. With every line of text, one needs to put the lifetime of the object to be extended for that one line in a comma seperated list (in the examples there were only two values).

It looked like Umlet is more sophisticated and customizable, while Sdedit text is more lightweight, elegant and readable.

One Response to “simplest ways of drawing UML sequence diagrams”

  1. Suresh Panje Says:

    New Delhi
    Eve of Pay Day of August, 2008 (* but my pay day is a week later)
    Dear Sanjay,
    Rightly you have said that the essence of ability to communicate ideas to others. Yes that is the binding factor of our social structure and among the animals too which we consider as ‘dumb’.
    In the context of communication, as a journalist I am always guided by the principle that the importance is in not what you say or opine but what not to say!
    Yes, it is a very logical fact.
    When you mentioned omlette, I am reminded of my encounter at the counter of a wayside eggs & eggs preparation vendor in Ahmedabad, where I usually spend my holidays at my elder brother Dinesh’s home. Yes, despite being born and brought up in an orthodox Konani family, I am not fussy about food (having served in the IAF and the visits abroad). Not that I am an cannibal but I don’t mind if cooked properly!
    Anyway, at this ‘Andawalabhai’ I was waiting for my ‘order’ of 2 boiled eggs and a ‘take home pack’ of 3 omlettes when a gentleman came along and ordered: Do Jain omlette banao. Well, I pinched myself to see whether I had one too many, from my quota of two bottles from Delhi, in the blessed dry State of Gujarat.
    Yes, the vendor nodded and prepared the Jain omlette and that it was without eggs.
    All said and done, coming back to art, although computers have worked wonders, at times I feel that they have snatched away the real art. Of course, creative minds can do fantastic designs with the help of a cursor and scanned images. But Art is Art.

Leave a Reply