Free UML modeling tools in Java

Features and usability of free, UML modeling tools in Java was a recent discussion topic on the Denver Java User Group's email list. I thought I'd share the recommendations, and provide links with more information.

Free UML modeling tools written in Java, in no particular order.

  • ArgoUML

    Import and export Java source. Exports/imports XMI files, so you can, for example, import a Rational Rose model (you lose the formatting, though). UML 1.3. Source code under BSD license. Supports multiple languages.

  • Jude

    Import and export Java source. Import just makes the classes available for modeling. Supports UML 1.4.

  • Omondo EclipseUML Free Edition

    An Eclipse plug-in for UML modeling. Eclipse Team support. Can create class and sequence diagrams from Java bytecode. Can model EJBs and servlets. Free version does not support Eclipse 3.0. UML 1.4. XMI support.

  • Visual Paradigm for UML

    This full-featured product offers six versions, priced from free to $700. The free versions have some features disabled or limited. Integrates with nearly all Java IDEs.

  • Violet

    Draws simple UML diagrams. Bare-bones program with small learning curve: no XMI, no reverse engineering, no validity checking. Source code available under GPL.

Other web sites with information about UML tools, including non-Java and non-free:

http://www.jguru.com/faq/view.jsp?EID=568126

http://plg.uwaterloo.ca/%7Emigod/uml.html

Did I leave out a great, free, Java UML tool? Please leave a comment and let me know.



Update Aug 15: I added Visual Paradigm for UML, pointed out to me by Mark Hayes.

Pasting text in MS Word without pasting its formatting

One of my all-time Microsoft Word annoyances is Word's assumption that when you paste text into your document, the text should carry with it all the formatting from where you copied it. The problem shows up most frequently when I copy text from a web page or from an email message that isn't written in plain text. This annoyance makes writing technical documents with Word much more annoying.

If you don't know what I mean, open a new Word document, go to a web page of your choice, copy some text from the web and paste it in your document. Word is pretty good about picking up everything you copied, including hyperlinks and the various HTML formatting.

But most of the time, I'm copying the text into an existing document with existing formats and fonts. I don't want the formatting from the web page (or email message, or whatever), I just want the text. How I formerly told Word to paste the text without the formatting was a little convoluted:

Edit / Paste Special... / As Unformatted Text / OK

Of course, since I prefer keyboard shortcuts, I'd actually do an:

Alt-E / S / U / U / Enter

because it's faster for me. Unfortunately, that was about as short as I could get this "shortcut." Word provides no keyboard shortcut, such as Shift-Ctrl-V, to paste just the text from the clipboard. I know because I pretty much went through all of Word's help documents, figuring there MUST be a way.

After living with this annoyance for too long, I finally looked beyond Microsoft for a solution and found this tutorial by Herb Tyson that explains how to create a macro to reproduce my several-step process into one keyboard shortcut. Now, when I press Shift-Ctrl-V, Word obediently pastes the clipboard text as text, just like I wanted. Finally, one Word annoyance down.

Hoisted by one’s own spam petard

The large parent company of the consulting company I work for sent out a mass email Monday informing its tens of thousands of employees about its new spam filtering policies. The email mentioned that new email server filters soon to be in place will remove email messages, and I quote:

  • Based on use of profanity, pornographic references, racial slurs or other inappropriate business language
  • Attachments known to carry viruses
  • Key words or phrases associated with spam (FREE!!!!!! NO COST!!!!!!!, lots of $$$$ or !!!!!!!!!)

And I bet you can guess what happened. That email got blocked by many recipients' own spam filters because of that last example. :)

“Synthetic” accessors when using inner classes

Today, I enabled Eclipse to warn me when my code accesses a "non-accessible member of an enclosing type" and learned something in the process.

From what I gather, code like the following:

public class OuterClass {
/** A log4j Logger. */
private static final Logger LOG =
Logger.getLogger(OuterClass.class);
// ... Methods defined for OuterClass
private class InnerClass {
InnerClass() {
LOG.debug("Created an instance of InnerClass");
}
}
}

causes the compiler to generate a package-private "synthetic" accessor method inside OuterClass to allow InnerClass to see the private LOG instance. From what I read, it seems since the inner class is compiled to a separate .class file, the runtime needs some way for inner class instances to access the private members of the outer class. Syntactically, and according to the Java Language Specification, non-static inner classes are allowed to access private variables and methods in outer classes. But how do those inner-class instances access the private fields and methods?

The solution most Java compilers seem to implement is to add extra (the JLS calls them "synthetic") package-private accessors to the outer class to allow the inner classes to see the private information.

My inner class in question is a private custom Iterator that I don't want others accessing directly. When I compiled the class in Eclipse with the "Access to a non-accessible member of an enclosing type" set to "Warning" (Window > Preferences > Java > Compiler > Advanced), it warned me that "Read access to enclosing field OuterClass.LOG is emulated by a synthetic accessor method. Increasing its visibility will improve your performance." So I searched around to find out what all this meant, starting my journey.

My search led first to this blog entry from Vladimir Roubtsov. That led me to an archived discussion of the topic from the ADVANCED-JAVA@DISCUSS.DEVELOP.COM mailing list to help shed more light on the subject. Vladimar's blog also references a discussion on this topic on the Eclipse cdt-dev mailing list, but it requires you to sign up to read that archived discussion. That discussion might delve further into what performance penalty you might pay by accessing the private members via generated accessors.

Since I don't want to increase the visibility of the private fields in my outer class, I'm going to live with any performance hit rather than break encapsulation.

Is Java 5.0 a brand name or a version number?

I'm trying to figure out what to call the new version of Java when it comes out this fall. Will Java 5 catch on, or will everyone except Sun and maybe book publishers call it Java 1.5?

I initially thought 1.5 would win, thinking the 5 was a marketing name, like when "Java 2" came out in 1998. But maybe Sun is taking the 5 more seriously as a true version number. Here's why this might be the case.

The official name of the new Java, as unveiled last month at JavaOne, will be "Java 2 Platform Standard Edition 5.0." See that? It's Java 2 5.0, not Java 5. It's the dot (full-stop, period, or whatever you call it) after the 5 that's making me think the name might be a real version number rather than a marketing name.

Before Sun released Java 1.2 on Dec. 8, 1998, it had re-branded the name as "Java 2" and called it something like the "Java 2 Platform, Standard Edition." But I don't think Sun ever said Java 1.2 would be called Java 2.0. Then, when versions 1.3 and 1.4 came out, the name was still Java 2 Platform Standard Edition, but with the version numbers attached.

With Java 1.5, Sun seems to be pushing the "5.0" brand as a version number, as if the next release will be 5.1. And it looks like they have to, because they're still using the "Java 2" brand in the name. I.e. this next version (Tiger) won't be called "Java 5 Standard Edition" version 1.5. It's Java 2, 5.0.

Anyone have any scoop on this from Sun? Is 5.0 a real version number rather than a marketing name? If you look at the J2SE page at Sun, there's a mixture of calling the new version of Java "5" and "5.0" -- i.e. a marketing name and a [marketing mame that sounds like a?] version number. The download for the beta is called "J2SE 5.0 Beta 2," so the "5.0" is sure starting to look like a version number. But then the URL to the "J2SE 5.0 Beta 2" page has 1.5.0 in it, http://java.sun.com/j2se/1.5.0/index.jsp.

So far, though, the beta versions of the JDK are still calling themselves 1.5. If you run this code with the 1.5 beta:

public class VersionInfo {
public static void main(String[] args) {
System.out.println(
"java.version=" +
System.getProperty("java.version")
);
System.out.println(
"java.vm.specification.version=" +
System.getProperty("java.vm.specification.version")
);
System.out.println(
"java.vm.version=" +
System.getProperty("java.vm.version")
);
System.out.println(
"java.specification.version=" +
System.getProperty("java.specification.version")
);
}
}

you get:

java.version=1.5.0-beta3
java.vm.specification.version=1.0
java.vm.version=1.5.0-beta3-b57
java.specification.version=1.5

So is 5.0 a version number or a brand name? Will the final release of Tiger show java.specification.version=5.0?