tags:

views:

749

answers:

14

Is there any software that can make UML diagrams from my Java code?

+2  A: 

StarUML can reverse engineer Java classes to class diagrams. We used it here to generate the diagrams, so I can tell from experience it works. However, if you use generics within your code, StarUML's parser will choke on them. Maybe newer versions fixed those.

Geo
+5  A: 

You have some eclipse plugins doing this. If you use eclipse, lookup eUML2 or Bordland Together.

Netbeans also has a reverse engineering tool.

If you don't want to depend on an IDE, StarUML also have a feature to do reverse engineering.

marcgg
+1  A: 

See this page: http://plg.uwaterloo.ca/~migod/uml.html which lists some UML tools and mentions if they're free, commercial, if they're able to "reverse engineer" from source, for what language they're written, etc. Some links are not valid any more, but many of them still are.

Bart Kiers
+1  A: 

There are a few - I expect you'll get a lot of answers.

Togeher is the best one I have used though.

serg10
I have not used it for a while, but I would second that opinion. It was the best for quickly pulling up a class diagram out of a source base, even one you did not know well...
Kendall Helmstetter Gelner
+5  A: 

A lot of UML tools support reverse engineering. Look for it in their feature list.

I use Enterprise Architect, which has this functionality (though I personally never use it!).

Chris R
I use Enterprise Architect also, and I've seen diagrams created by my coworkers with it using reverse engineering from Java code. I never used that feature, too many small details included.
JuanZe
its not free, so its useless. why would you invest time in getting to know something that you cant always use? too much free time.
01
+2  A: 

On Linux, I've been pretty happy with Umbrello.

rascher
ello... ello... eh... eh... eh... (sorry ;))
Chris R
@Chris: i lol'ed. :)
Malax
A: 

Slime UML is a neat, small, free eclipse plugin that builds UML class diagrams off your code.

rsp
+1  A: 

I like ArgoUML.

matt b
I've had good experiences using this. But it's been a good while since I've dealt with UML.
Jon Homan
No copying of multiple elements at once and no undo. Or am I just not seeing it? I kind of hate it for these two things.
Ronny
A: 

If you are using Eclipse there are several plugins to do it. Chech:

http://eclipse-plugins.2y.net/eclipse/plugins.jsp?category=UML&sort=hits24h

JuanZe
A: 

Why don't you just check SO topics which are tagged with the same tags? http://stackoverflow.com/questions/tagged/java+uml

BalusC
he got 7 up votes, thats why.
01
my bad, now its 11.
01
+1  A: 

MagicDraw UML is also can do reverse engineering

igorp1024
+3  A: 

AmaterasUML is an Eclipse plugin that can take a class (or several) and generate a class diagram. Just drag their .java files onto a blank class diagram.

The diagrams are static (changing the .java does not update the diagram) so I generally don't save the class diagram for long. They are mostly useful for visualization of existing code.

I also find the diagrams helpful during code reviews to give an overview before diving into the code.

Chris Nava
thanks =) this worked just fine, easy to use and eclipse is the IDE I've been using for the project
Johannes
You're welcome. I should note that dragging multiple classes at once onto a diagram will connect the class images with arrows. Adding them on at a time will not.
Chris Nava
A: 

JUDE Community Edition does a nice job of reverse engineering Java. It's up to JDK 5 as well.

duffymo
A: 

See http://www.reversejava.com for a dynamic reverse engineering application which generates UML Sequence diagram and view of Participating Class diagram from any Java Application at runtime All you have to do is just run your application and sit back. Reverse Java runs in background tracing all the activities happening inside your application and creates UML diagram for you.

You also have options for, excluding packages,editing the Sequence diagram and exporting the diagrams as PDF or Image.

And its not expensive !

Rajesh Jadhav