Rip UML straight out of java
I’ve been playing with the idea of taking the UML straight out of java, so I can do multiplatform UML Sketching using basically plaintext .
So I went and downloaded UMLGraph and incorporated it into the my build system.
So far I like it, but I have a couple of thoughts on it.
- It would be nice if it allowed for translating accesors into attributes. For example, a piece of code such as:
public void setFirstName(String firstName);
public String getFirstName();
Should be modeled as a single “firstName” attribute. This should be configurable per class. This is specially important if you use DAO a lot. I think it’s important to know at a glance if there are extra “operations” other than basic field access.
- I haven’t tried very hard yet, but from the docs it is not obvious how to create a sequence diagram. It mentions the syntax, but where do you put this text? In the comments of the file? In a new file? What’s the extension it expects? Will it scan for it automatically or do I need to call the command line in a special way? Sequence diagrams feel a bit like an afterthought. Maybe I’ll feel different once I get one to work. 😉
- UMLGraph seems to create one (1) diagram per invocation. I had to write an ant task that called another ant task for each of the packages I wanted to generate a graph for. It would be nice if it tghere was an option for “one graph/page per package” or something like that. Calling it with all your source gives you a giant diagram that really stresses the Windows Picture Viewer. 🙂 Apparently Maven’s DotUML Plugin uses UMLGraph and supports this feature by setting the property maven.dotuml.singlepackage to false.