Goals and Propaganda
- Textual Notation vs. Visual Tools
- Automatic Generation of Diagrams
- UML Packages for TeX/LaTex
- MetaUML on the Net
Donald Knuth created TeX to enable people (himself included) to typeset beautiful documents. It is a pitty really that in the field of UML --- a visual notation --- there is no comprehensive-enough TeX/LaTeX package to set the quality standard. MetaUML is a modest attempt in this direction. Nevertheless, there is much work ahead before eventually reaching UML 2.0 compliance.
Textual Notation vs. Visual Tools
Visual tools are here to stay, and I'd prefer them in important usage scenarios. However, there are several areas in which textual notations would excel.
- Refactoring. If you want to rename all methods from all classes in a diagram from "update*" to "set*", you can do that in a flash if you have a textual notation. This would be a tedious thing to do in a typical visual tool: a lot of mouse moves, a lot of clicks. In addition, with a textual notation you can use more advanced regular expressions to modify or extract/process information from the diagram.
- Differences between diagram versions. Handling different versions is an important process in modern software organization. In a visual-only diagram, you have to "parse by eye" the differences, while with a textual notation you can simply use a "diff" program to get reliable results.
- Version control. It is much easier to work effectively with a textual notation in a CVS or subversion environment.
- Diagram publication. Suppose that the diagrams must go in a document which specifies the application architecture. Whenever you make a modification to a diagram, you have, by hand, to save it into the native format, to export it into a graphics format, to take that graphics format and replace the old figure in the document. Since this requires human involment, the process is by nature expensive. With a textual notation like MetaUML, you can easily write a script to do that automatically.
- Tool independence. With virtually all visual tools you need that tool installed and running to make a modification to the diagram. From a practical viewpoint, XMI is useless here. MetaUML's notation is human-friendly, and you can modify a MetaUML diagram in any text editor.
Automatic Generation of Diagrams
It is often useful to generate UML diagrams automatically from code: the UMLGraph project is a very nice effort in this direction. However, UMLGraph's approach is to automatically generate the layout of the diagram. While this useful for fast prototyping, it doesn't offer enough control in a text-book for example, when you want that diagram typeset exactly the way you want. MetaUML was primarily designed with this in mind.
Initial experiments show that, with MetaUML, it is also possible to generate diagrams from Java code. Any efforts in this area are welcome!
UML Packages for TeX/LaTex
It's easy for me to give an overview of the TeX/LaTeX UML packages, because there I found, well, only tree of them: uml.sty, pst-uml.sty and MetaUML. To me at least, MetaUML code appears easier to read and understand.