Agile modeling with UML 2 templates for Visio

I have been working on putting together the documentation for a project these last few days and I use Visio for all my diagrams. I don’t always create UML diagrams for my projects because they just take too much work. UML in Visio is difficult to use as pure documentation since you also need to create the underlying structures for it to work properly and there is some pretty extensive validation built in, although obviously nothing like Rational’s software. I was working on a sequence diagram when I realized that some of the UML features that I wanted to use where not implemented in Visio. I have never really thought about it but it turns out that Visio only supports UML 1.2. There have been several minor revisions of the UML specification since 1.2 was released in 2002 and the latest version of UML is 2.0 (I believe that 2.1 is on its way).

Searching the Internet I quickly found UML 2 template support for Visio at Software Stencils. These are simply new shapes for Visio with some smart behavior. Unfortunately you don’t get any help with your UML syntax using these templates, so you either have to know your UML or accept that your diagrams don’t conform to the UML specification. They are not useful for forward or reverse engineering nor are the artifacts integrated with each other so a change in one place will not propagate to other instances of the same artifact in other places. Maintaining you diagrams is potentially more work with the new templates than using the built in UML support that Visio offers. On the other hand maintaining UML documents that are not integrated with your code is just a lot of work no matter how you do it. But who really uses UML in a completely integrated modeling tool? You can only realistically expect the static structure / class diagrams of UML to be integrated with your code, getting automatic generation of activity or sequence diagrams at the right level of granularity seems to me to be too much to expect. And if you use Visual Studio 2005 you will probably use the built in Class Diagram support instead, which is a visual representation of your code and allows refactoring and reworking of your code through the diagrams. Channel9 has more info on the Class Diagram / UML debate.

In the end this really begs the question of what we want to use UML for. I am in the Agile Modeling camp we should be using UML and other modeling tools as abstract representations of our system to enable communication of the concepts and structures that exist or could exist in our software. A whiteboard or a napkin should be all that is necessary to start modeling your software together with others. Just taking a snapshot of your whiteboard after you have finished drawing is enough for team documentation. Sometimes you want a more formal look for including your models in official documents or for presentations and that is where Visio or any other modeling software comes in handy; simply a way of getting your diagrams into an electronically editable format. My colleague Peter Tallungs is a firm believer of Word’s built in diagramming support as the best way to document your models since this does not require any additional software from your readers (article published in Computer Sweden in Swedish). I guess I agree with him in principal but in practice I find that the lack of built in support for software diagramming in Word just makes it too difficult to work with your models. For all of us who want a balance between formal modeling, agility and ease of use the Software Stencils templates offer a perfect solution for Visio.

Useful UML resources

Leave A Comment...

*