An Update on UMLGraph
Today I released version 5.0 of UMLGraph.
This release contains a couple of important changes: six new shapes
(components, nodes, collaborations, use cases, notes, and active classes),
a facility for adding notes, and the hosting and packaging under its
own domain name umlgraph.org
.
The shapes and notes features have a long history. I realized I needed them when I first created UMLGraph, and users were asking for them by as early as 2003. However, because UMLGraph uses GraphViz for rendering the graphs it creates, I could only support the built-in shapes of GraphViz. I had twice tried to extend GraphViz with new shapes, but got stymied by the code's complexity and gave up. This fall I tried again with a different approach, and in a few hours I had managed to create my first shape. Adding others was a matter of a couple more days. I could easily justify spending my time on this, because the GraphViz developers had already accepted work from me in the past, so I was fairly certain that my work would end up in the GraphViz distribution, and thereby be usable in UMLGraph. Indeed, the version of GraphViz released on November 9th (2.16) supports my new shapes, and this allowed me to continue with adding the infrastructure in UMLGraph. These are the benefits of working on an open source ecosystem.
In UMLGraph a new option @opt shape
allows one to specify
the shape of an entity's box.
While it is a bit unnatural to use Java's classes to draw collaboration,
component, or deployment diagrams, it's nice to reuse your skills in
declarative modeling with UMLGraph in other diagrams,
and there are also better plans for the future.
Another tag @note
allows the annotation of elements
with notes (comments), and yet another, @opt showcomment
names boxes with the javadoc comments instead of the class name.
This allows giving names that would be illegal as Java classes.
Here is an example of a UML diagram
demonstrating the new features and the corresponding
declarative specification.
/**
* @hidden
* @opt nodefontcolor "blue"
*/
class UMLNoteOptions{}
/**
* Structural Things
* @opt commentname
* @note Notes can
* be extended to
* span multiple lines
*/
class Structural{}
/**
* spelling.java
* @opt shape component
* @opt commentname
* @note Component
*/
class Component extends Structural{}
/** @opt shape node */
class Node extends Structural{}
/**
* Chain of
* responsibility
* @opt shape collaboration
* @opt commentname
* @note Collaboration
*/
class Collaboration extends Structural{}
/**
* Place order
* @opt shape usecase
* @opt commentname
* @note Use Case
*/
class UseCase extends Structural{}
/**
* Business rules
* @opt shape package
* @opt commentname
* @note Package
*/
class Package{}
/**
* @opt all
* @note Class
*/
class Counter extends Structural {
static public int counter;
public int getCounter();
}
/**
* @opt shape activeclass
* @opt all
* @note Active Class
*/
class RunningCounter extends Counter{}
The hosting and packaging of UMLGraph under its own domain name
umlgraph.org
paves the road for even more exciting changes.
The original name used, spinellis.gr
, was, I believe,
sending the wrong signal to the UMLGraph community,
indicating that the project is a one-man-show.
This was never true, but perceptions matter.
Although I don't intend to stop working on the system,
I hope that this change addresses the perception problem.
A major project on UMLGraph is now a series of changes planned by Rafael Chaves, who will move UMLGraph to EMF and the Eclipse UML2 API, open up UMLGraph as a rendering engine for other API-conforming tools, and all that while providing backward compatibility with the existing interface. Stay tuned.
Read and post comments