Friday, December 11, 2009

UML diagram editors

From time to time people ask me to write UML diagrams. Sometimes it makes sense, but oftentimes I could be better off using my time on something else, like writing code, prototyping etc. Please don't get me wrong, I am not against good documentation or UML per se, but many people like to focus too much time on pretty documents with beautiful colorful diagrams while others, more pragmatic ones, prefer instead to have a system built on time, with quality and running in production. I like to think of myself as part of the "pragmatic" group.

I KNOW documentation is important, it can make the difference of people using your software or not, or your development team implementing what your client actually needs instead of something completely outlandish. That is not my point. My point for this post is that we should generally try to stick with what we are good on, but sometimes we just dont have a choice and have to work on something we KNOW isn't one of our strong skills. I thought PMs were supposed to limit such times, making sure tasks are assigned to the best resources based on their talents, but from my experience this is not exactly how it generally works. Not necessarily because of the PMs, sometimes they just don't have better resources to tackle the job.

But regardless what I think, as much I try to avoid wasting a lot of time writing documents that no one will read, sometimes I have no choice and just have to do it. I guess that is why they call it work, we can't like all that we do for a living. But what I can do is to try to finish it as quickly as possible, while still developing good quality documents. Which bring us to graphical design talent... and this is one area of talent that, I must confess, I am not especially gifted. I've worked with people born with natural talent for graphical design, they could use pretty much any tool and come up in few minutes with amazing diagrams or images or web site layouts etc. Think like someone opening Microsoft Paint and drawing a Mona Lisa in few minutes - yeah, I know, that was a stretch, but the point is, this is one of the things in life that you are either born with or you are not. Sure you can learn techniques to improve, but your true potential is more or less apparent from the early start.

Now the question is, how someone who's not a superfast gifted designer can create decent looking diagrams fast? My answer is "with especialized tools that format most things for you and you just have to enter the data". Think something a bit more especialized than Microsoft Visio. I can spend hours on Visio, moving lines and boxes, changing colors etc, and no matter what I do on it it will always end up looking like a pig. Before people say I did not try enough I can say that I tried learning from articles and books about it, but after some time I just accepted that I'm better of spending my time designing server-side frameworks, integrating enterprise applications, working with web services etc than creating striking-looking diagrams and working with web design. Which is actually quite liberating, to accept that I should leave such things for other people more gifted than myself while focusing on what, I like to think, am good on and like a lot to do. We should not try to do everything, but to focus on what we LIKE to do, right?

So what can I do when I need to write diagrams so they at least look decent and describe the concepts and ideas I am trying to document? And are finished quick so I can move on to other tasks? Well... tools that automatically generate the diagrams for me is a good start, I would think.

For example, NetBeans can automatically generate a UML class diagram from your source code. The generated diagram will be complex and unless you do some additional editing to filter out some of the noise no developer would ever waste time reading it, they would obviously prefer following the source code instead (assuming your source code is decently written - it is, right??), but it does look decent to see on a document or presentation. For those who dont know, it would appear that you put a lot of time on it... yeah, right! :P

Ok, so NetBeans is fine... but most times when I need to write UML diagrams I still do not have the classes yet, I am still discussing the solution design with a team. So I need something more flexible than that. But not too flexible that I would have to spend ages moving lines and boxes here and there! That is when I found a ridiculously small application called Quick Sequence Diagram Editor (QSDE).

Different than most similar tools, in QSDE instead of moving graphical elements around with your mouse you actually PROGRAM the sequence diagrams! I initially thought it was stupid and it would take much longer to write diagrams this way than just using the mouse... man I was wrong, and I am glad I kept trying to use this little gem. Now I can draw sequence diagrams real fast using QSDE.



Another decent UML tool that I used for other UML diagrams than sequence is StarUML. It is free and pretty decent for class diagrams, check it out.



This is just a simple (and lame) diagram made with StarUML

# References:

• StarUML - http://staruml.sourceforge.net/

• Quick Sequence Diagram Editor - http://sourceforge.net/projects/sdedit/

No comments:

Post a Comment