Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Are there eclipse plugins that you can recommend for generating diagrams (UML, sequence) from Java code?

share|improve this question
10  
You could consider marking an answer as accepted. :) – pavanlimo Aug 18 '10 at 8:37
7  
I have yet to find a suggestion that I really like. :) – Jonathan Oct 14 '10 at 10:41
1  
That is unlikely to happen. Real Java code is not structured to look pretty as UML diagrams. – Stephan Eggermont Feb 9 at 1:24

11 Answers

ObjectAid UML Explorer

Is what I used. It is easily installed from the repository:

Name:     ObjectAid UML Explorer
Location: http://www.objectaid.com/update

And produces quite nice UML diagrams:

Screenshot

Description from the website:

The ObjectAid UML Explorer is different from other UML tools. It uses the UML notation to show a graphical representation of existing code that is as accurate and up-to-date as your text editor, while being very easy to use. Several unique features make this possible:

  • Your source code and libraries are the model that is displayed, they are not reverse engineered into a different format.
  • If you update your code in Eclipse, your diagram is updated as well; there is no need to reverse engineer source code.
  • Refactoring updates your diagram as well as your source code. When you rename a field or move a class, your diagram simply reflects the changes without going out of sync.
  • All diagrams in your Eclipse workspace are updated with refactoring changes as appropriate. If necessary, they are checked out of your version control system.
  • Diagrams are fully integrated into the Eclipse IDE. You can drag Java classes from any other view onto the diagram, and diagram-related information is shown in other views wherever applicable.
share|improve this answer
1  
Great tool! It helped me refactor my type hierarchy easily. – HappyCoder Apr 10 '12 at 7:06
Easier than Papyrus, but with less options to create diagrams. – lcardosobr Jul 30 '12 at 14:13
In ObjectAid, Is there a way to auto arrange the class diagram? – Reusable Nov 21 '12 at 9:44
If only it would italicize interfaces... – advs89 Feb 18 at 0:13
3  
HowTo >>> Create account here: objectaid.com/login (activation email was send in 10minutes), Click Diagram Add-On, licence will be send to your email. Follow this objectaid.com/installation to install ObjectAid, then install GEF from download.eclipse.org/tools/gef/updates/releases Now copy-paste licence from email to Window->Preferences->ObjectAid How to create diagram? objectaid.com/class-diagram – Pan.student Apr 5 at 22:01

What is your codebase? Java or C++?

alt text

eUML2 for Java is a powerful UML modeler designed for Java developper in Eclipse. The free edition can be used for commercial use. It supports the following features:

  • CVS and Team Support
  • Designed for large project with multiple and customizable model views
  • Helios Compliant
  • Real-time code/model synchronization
  • UML2.1 compliant and support of OMG XMI
  • JDK 1.4 and 1.5 support
  • The commercial edition provides:

  • Advanced reversed engineering

  • Powerful true dependency analyze tools
  • UML Profile and MDD
  • Database tools
  • Customizable template support
share|improve this answer
12  
This is a very difficult tool to install. I tried for about half an hour with no success. Any other suggestions? – Jonathan Sep 9 '08 at 15:07
2  
Cant find eUML2 is my Update Managaer and I dont want to pack a new Eclipse setup just fr this feature. I'm using Eclipse "Helios" and go this way: Help - Install new Software - Helios download.eclipse.org/releases/helios - Modeling – OneWorld Sep 15 '10 at 9:55
3  
I know this is an old post, but most problems with installing eUML2 seem to have been resolved. – Andy Apr 27 '11 at 10:55
4  
eUML is real crap. It has changed my code format and added tags everywhere. My code is now so dirty that I prefer to undo the change. The problem is that there is no undo and your code is changed for ever. I would recommend to backup your project before using eUML crapper :-) – UML GURU May 4 '11 at 8:08
15  
Did you ever hear about version-control? – devoured elysium May 17 '11 at 4:45
show 6 more comments

EDIT: If you're a designer then Papyrus is your best choice it's very advanced and full of features, but if you just want to sketch out some uml diagrams and easy installation then ObjectAid is pretty cool and it doesn't require any plugins I just installed it over Eclipse-JEE and works great !.


Trust Me in June 2012 it's Papyrus, I wish I could write about my experience with the rest of tools like eUML2, UML Lab, ObjectAid, I've tried around 11 UML plugin some I couldn't pass installation process bugs and others turned out to be commercial eUML2 the free edition is uninstallable and the UML Lab (Fancy and great but) is commercial !

Notes:

  1. Be aware that most of the plugins hangs when processing so many classes at once but papyrus seems the strongest to hold.
  2. The old papyrus project had Synchronization option but it wasn't shipped when they merged with eclipse until this happen let's follow another way

So let's talk about Papyrus Installation I will guide you to how I did what you wanted to do which is Java To UML

  1. To save lots of plugins incompatibility and trust me it happens you need to have the latest eclipse modeling tool IDE version.

  2. Help-> install modeling components and install the following before you install papyrus {xtext SDK ,Acceleo SDK, Modisco make sure modisco discoverer) then install papyrus

Generating UML

  1. Project -> right click-> Discovery -> Discoverer -> Discover KDM code from java project model --> You'll get a property dialog box at the serialization line make set it to TRUE that would generate a file project_KDM.xmi

  2. Right click that file -> Discovery -> Discoverer -> Discover UML model from KDM code again you'll get a property dialog set the serialization prop to TRUE to generate a file named project.UML

  3. create a folder in your project and copy that UML file to it, this is because sometimes when you delete the papyrus files along with UML files it messes up with the .project file and makes your project loses the Library runtime settings so just put them in that folder instead of main project folder "/" .

  4. now go to that folder you created, and pasted the UML file there, then right click on the project.uml file --> new --> papyrus model -> and finish

  5. This will create empty project.di file but it in someway references the uml (I wish I knew at the moment how to import the UML file and create so many *.di files but for now I don't so just do it the way i did)

  6. ALT+W -> show view -> papyrus model explorer

  7. In that view you'll see that your classes are in there and imported but they aren't yet imported to any diagrams so in the next picture you can create a class diagram NOTE: the classes you see in the diagram are because I've already another class diagram done.

  8. enter image description here

  9. Then start dragging and dropping any class

  10. To show the class elements (vars, functions etc) right click on any class -> Filters -> show/hide contents Voila !!

  11. You can go to pereferences -> papyrus -> class diagram -> change class colors for more friendly color than the empty white boxes

  12. one very important setting is Arrange when you drop the classes they get cramped right click on any empty space at class diagram and click Arrange All

  13. You'll also find in the Root model (Model explorer view) some elements with Arrow icon beside called unnamed , actually these are the relations between the classes if you grab and drop them you'll see the relation each arrow represents

That's all, Don't buy commercial stuff, papyrus is actually great and sophisticated instead buy them a beer (donate). Disclaimer: I've no relation to the papyrus people infact i didn't like papyrus at first until I did lots of research and experienced it with some patience.

share|improve this answer
1  
I hope this bubbles up further. – Thomas Ahle Jul 18 '12 at 8:52
Thanks @ThomasAhle :) – Ismail Marmoush Jul 19 '12 at 20:34
@IsmailMarmoush +1 dude. I've added more info, which is pending review. – DaveM Mar 25 at 17:04

I don't have enough privileges to comment on answers,but just to add to first answer, I used eUML2 and it was really easy to download,install and use.At least for Galileo and Ganymede it works fine.

share|improve this answer
19  
+1 for getting nearer to be able to comment ;-) – Jan Apr 14 '11 at 10:14
3  
eUML adds model tags directly in my code. It changes therefore my code structure without even asking me if I agree. If I refactor then I loose my diagrams which can not be opened anymore. The reverse is showing more and sometimes less methods than it really exist. etc.....this tool did have some potential but the bugs have never been fixed. It is still the same release since 2007. It is a no go now in my company and we have switched to other tools. – UML GURU Nov 15 '11 at 9:34

How about PlantUML? It's not for reverse engineering!!! It's for engineering before you code.

share|improve this answer
Doesn't answer the question, which clearly asks for a reverse engineering tool. – jmite Nov 29 '12 at 23:17
I'm not sure that's completely correct. PlantUML is also able to describe code with diagrams. Try opening the relevant view in a class filee – Erez A. Korn Dec 3 '12 at 8:14

I would recommend EclipseUML from Omondo for general usage, although I did experience some problems a few months back, with my web projects. They had a free edition at one point in time, but that is supposedly no longer promoted.

If you are really keen on reverse engineering sequence diagrams from source code, I would recommend jTracert.

As far as Eclipse projects themselves are concerned, the Eclipse UML2 Tools project might support reverse engineering, although I've have never seen its use in practice.

The MoDisco (Model Discovery) project Eclipse GMT project seems to be clearer in achieving your objective. The list of technology specific tools would be a good place to start with.

share|improve this answer
Have not found that reverse engineering feature in UML2 Tools ;( – OneWorld Sep 15 '10 at 9:57
2  
jTracert is now discontinued. A successor of jTracert, a new tool called jSonde is now licensed under GPL v3. jsonde.com – Alpine Feb 25 '11 at 15:02
Omondo is the best for java. Really clean integration, no mix between model and code. Superb but too expensive. We have been allowed to buy only one license but we are over 20 modelers using it because the security is based on the username login. It means that if 10 users have the same login then all of them can use it. We got a licence with Admin username :-) – UML GURU Nov 15 '11 at 9:35

You could also give the netbeans UML modeller a try. I have used it to generate javacode that I used in my eclipse projects. You can even import eclipse projects in netbeans and keep the eclipse settings synced with the netbeans project settings.

I tried several UML modellers for eclipse and wasn't satisfied with them. They were either unstable, complicated or just plain ugly. ;-)

share|improve this answer
Just wanted to mention that I've also used Netbeans UML modeller and didn't bump into problems in my relatively simple cases. The UI is not too intuitive, but it's totally ok. The modeller also has some advanced features such as creating JPA entity code out of model if I remember correctly. – Tuukka Mustonen Jun 21 '10 at 12:10
1  
Unfortunately is seems like the UML plugin is no longer supported. A rewrite of the plugin is apparently underway but that does not help anyone since they dropped the old plugin before the rewrite was completed. – Appak Feb 2 '12 at 23:01
That's a bummer :-( Let's hope that the rewrite doesn't take too long :-) – Patrick Cornelissen Feb 8 '12 at 14:46

You can use the 30 days evaluation build of EclipseUML for Eclipse 3.5 : http://www.uml2.org/eclipse-java-galileo-SR2-win32_eclipseUML2.2_package_may2010.zip This is not the latest 3.6 build but pretty good and don't need to buy it for testing reverse engineering.

Reverse engineering : http://www.forum-omondo.com/documentation_eclipseuml_2008/reverse/reverse/reverse_engineering_example.html

Live flash demo: http://www.ejb3.org/reverse.swf

EclipseUML Omondo is the best tool in the world for Java. Only eUML seems to compete with him on this live java synchronization market but eUML add model tags in the code which is really very very bad and a definitive no go for me.

share|improve this answer

I found Green plugin very simple to use and to generate class diagram from source code. Give it a try :). Just copy the plugin to your plugin dir.

share|improve this answer
1  
Green seems like it has potential. However at my work we have a project that has ~700 classes and it chugs for a little bit then dies. – Appak Feb 2 '12 at 22:27

Something very simillar has been asked before.

By far the best tool I have used for reverse engineering, and round tripping java -> UML is Borland's Together. It is based on Eclipse (not just a single plugin) and really works well.

share|improve this answer

IBM Rational Systems Developer has this feature built-in. You can do C++ to UML or java to UML transformation..

share|improve this answer

protected by YOU Apr 17 '11 at 12:10

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.