uml2svg 0.17 review

Download
by rbytes.net on

uml2svg is an XSLT-based tool for converting XMI-compliant UML Diagrams into SVG. We started the developing uml2svg with six main

License: LGPL (GNU Lesser General Public License)
File size: 0K
Developer: uml2svg Team
0 stars award from rbytes.net

uml2svg is an XSLT-based tool for converting XMI-compliant UML Diagrams into SVG.

We started the developing uml2svg with six main goals in mind:

Standard conformance
Good Documentation
Modularity
Extensibility
Comprehensible SVG
Multiple diagrams per XMI-file

SVG is a standard language for describing two-dimensional vector graphics in XML. As the open SVG standard gains in popularity and gradually replaces proprietary formats for vectorial graphics, the support provided by the Web browsers is getting better.

Plugins to display SVG exist for most browsers and it is most likely that the next generation of Web browser will provide built-in support for SVG. When that happens there will be no better way to distribute vector graphics on the web. Furthermore, not only web browsers can process SVG in a meaningful way; in fact that is just the tip of the iceberg. SVG can be easily read in, processed, and then transformed into many other formats, being well suited for both text and graphic tools as well as for web agents and screen readers.

UML diagrams are composed of lines, polygons, ellipses and text labels, so they are inherently vectorial. However, the SVG is not very well suited for direct use by UML tools. While some of them can in fact export UML diagrams directly to SVG, they do that by discarding all the information about structure, and converting everything into a shape. Moreover, some tools use the screen-capture function provided by their environment (such as java2d) and then they apply a filter to generate SVG out of the "screenshot".

What comes out of that is a pile of meaningless information, which by accident happens to draw a gorgeous diagram. How will a screen reader interpret such a file? How will a web crawler be able to index it? How will a web agent process it in a meaningful way? A program needs the semantic information that the humans can extract just by looking at a picture. For a machine, an obfuscated SVG file is not easier to process than a PNG file or any other image.

Although for humans it is better to be able to scale the image, for a program this is irrelevant. Programs need a way to "understand" the semantics of the UML models to be able to process and interchange them in a meaningfull way. This was the main idea behind the XML Metadata Interchange (XMI), an OMG specification for model interchange. And probably the best use that XMI has found so far is the exchange of UML models between different modeling tools. And while the XMI provides a standard way for tools to represent models as XML documents, it is still limited to the model elements only.

With the introduction of the UML 2.0 Diagram Interchange Specification as part of the upcoming UML 2.0 standard, it will become possible for tools to exchange the models together with the layout of the diagrams. We think that, once this specification appears, XMI will be used averywhere. Not only will the tools be able to exchange diagrams, but could even represent them internaly as DOM trees. Have you ever considered drawing your UML diagrams online, using only a web browser? This could be done even now by using a custom SVG syntax for the DOM tree, but a solution based on XMI could do even better and be a standard at the same time.

Therefore, we believe that with the advent of UML 2.0 and the increase in the use of SVG, the need for transformations between XMI and SVG will be great. Nevertheless when the uml2svg project was started, there was hardly any good open-source solution to convert XMI diagams into SVG.

The UML 2.0 Diagram Interchange Adopted Specification in its current incipient form references a set of XSL transformations. Although the standard draft covers them to a large extent, the link is actually broken (you can try for yourself). It has been broken for more than a year and most likely it will stay like that forever.

The personal webpage of Professor Mario Jeckle provides an online transformation service capable of dynamically generating SVG from XMI-compliant XML files. The XSL files accomplishing the transformations are also available on that website. These transformations are monolithic and not well documented (the only documentation is in the code, and it is generally written in German). With the tragic accident that took the life of Professor Jeckle, the transformations have no longer been maintained.

Finally, the STZ-IDA research center in Karlsruhe had to convert UML diagrams to SVG, as part of one of their projects. The XSLT stylesheet they created for this purpose was named xmi2svg and is available under the terms of the MIT license. At the time we started work on uml2svg the only type of diagrams supported was class diagrams.

Recently the package reached version 0.2 and it supports more diagram types, without major changes in the code (the opposite of what we were expecting). Andreas Junghans, the author of xmi2svg, provided us with a lot of insightful hints which helped us eliminate many glitches in uml2svg. It looks that the development of uml2svg and xmi2svg will continue in parallel, at least for a while. The good thing about this is that the two (quite different) implementations prove each others validity and the features tend to propagate freely from one side to the other. However, this comes with the prize of having to maintain two different code-trees and possibly confusing some users.

We did not like the two existing solutions because they were:
incomplete - just prototypes, not well suited for production environment
monolithic - hard to maintain and extend
not documented - hard to understand

At first sight, we thought we could find a way to improve one of the existing solutions and just add the features we needed. However, we slowly came to the conclusion that it would be better if we started anew. There are things one can fix in a project, but that does not include what we thought is was bad design. The fact that the two implementations presented above are open source helped us get quickly on the way with our own project.

What's New in This Release:
Support has been added for UML 2.0 activity diagrams.

uml2svg 0.17 search tags