UML Templates for Visio

The Holub UML Stencils for Visio™, Version 2.10.
This template, and all contained shapes, are ©1998 Allen I. Holub. You may use them freely, but you may not redistribute them. Period.

I do modify (and, hopefully, improve) these shapes periodically. To find out about updates, either subscribe to my mailing list or check back occasionally to see if there's a new version. If you find a bug in any of the shapes, or have suggestions for improvements or things to add, please contact me.

I'm not happy with any of the OO case tools. They're all way too expensive for what they do, and a good drawing program does as much for you as a fancy case tool. I do most of my work with a pencil and paper, but when it comes time to make things pretty, I use a drawing program, not a case tool. Visio™, the program in question, is not the best drawing program out there: It has an idiosyncratic interface, and putting together custom "shapes" is like going through hell; the documentation is spotty and the customization UI is miserable. Even worse, it only works under Windows. Nonetheless, Visio does do the job once you've beat it into shape, and I've done the hard part—puting together a shape library—for you.

Here is a .zip file that contains the Visio 5.X template and stencil files that I use to do UML diagraming. (And here's a Visio 4.x version.) The template contains all the shapes necessary to create the UML drawings that I use: Static-model diagrams, Sequence diagrams, Activity Diagrams, and State Diagrams. All of the shapes with red dots in the lower-right corner of the icon were developed by me from scratch. A few (Auto-route connector, Hand-routed connector, Inheritance tree) are hacked-up versions of standard Visio shapes. The Qualifier shape is stolen from Pavel Hruby's UML template, which can be fetched from Microsoft. These templates are different from mine, but are equally useful.

Using the shapes

The main things to know about using the shapes is that the connection points stay put, so you can change the size of something without affecting the connection lines. Most shapes have a (right-click) popup menu that lets you customize them relatively painlessly. (For example, you can change the line ends on the "Association" and connector shapes in this way. The connector shapes are reasonably intuitive; there is a "shape" help that describes how they work if you need pointers. (Pick "shape help" from the right-click menu.) Same goes for the "Inheritance tree," but not for any of the shapes that I've invented.

A bug in Visio seems to damage the class-box shapes when they are copied. You wont' notice this problem until you try to resize a copied class box, in which case it appears to break up into several pieces. It's best not to copy class-box shapes.

The next issue is the "Composition" line end (a solid diamond) that I've put in the the UML stencil. Visio doesn't see a new line end until it's been used explicitly from the Format:Line dialog. I've done that already in the UML template that's in the .zip file, but if you use my UML stencil in some drawing that didn't start out life as my UML template, you'll have to select "Composition" explicitly on some line before it will start working. (With your drawing active, load my stencil into Visio using the File:Stencils:Open Stencil menu. Draw a line, and while the line is highlighted, bring up the Format:Line dialog from the main menu. Then select "Composition" as either a begin or end arrow. [it should be at the bottom of the list]. You can then erase the line.)

Finally, the best way to change the size of the "Class or Interface," or "Class Proxy" shapes is to add or modify text within the box---the shapes resize automatically as you add text. Once you've changed the size manually, however, the shapes will no longer resize automatically. Similarly, once you change fonts manually (by using Visio's font-change menu or equivalent), the pop-up menu's font-change item won't work. I use the "Class Proxy" as an "Activity" shape as well.

I do intend to put a full-blown user's manual for these shapes up here eventually. subscribe to my mailing list to be notified if I actually do it.