GeeCON Prague 2014*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Code to UML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Code to UML" Watch "Code to UML" New topic
Author

Code to UML

Lucky Singh
Ranch Hand

Joined: Jan 19, 2004
Posts: 125
I have some Java code. Is there a tool where I can use the code as input and generate UML diagrams?
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
magicdraw does it, and the inverse too


java amateur
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
There are a couple of tools.

What do you need the diagrams for?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Rose and any of the big players have "reverse engineering" features.

You almost certainly will hate the results, though. The tools take every miniscule bit of the code literally and show way too much detail. One value of modeling is to abstract away the things that don't matter to reveal the things that do matter. Reverse engineering usually buries you in detail so it's no easier to find the things that matter than it was by reading code.
[ March 28, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Lucky Singh
Ranch Hand

Joined: Jan 19, 2004
Posts: 125
Its part of a project where I need to analyze code. I guess analyze means to draw the UML diagrams.

Also, I tried using magicdraw. You require the commercial edition to reverse engineer. The community edition does not allow you to convert Java code to UML.

I have Poseidon but reverse engineering is not for the community edition. We need a commercial edition for reverse engineering in Poseidon as well.

Can someone suggest some tool which is free and available on the net?
[ March 27, 2005: Message edited by: Lucky Singh ]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Lucky Singh:
Its part of a project where I need to analyze code. I guess analyze means to draw the UML diagrams.


To "analyzing code" means to try to *understand* the code. It might be a good idea to draw some UML as a rough map to help you not get lost, or to help communicate your understandings to others. I wouldn't expect automatically generating UML from code to be of great help, though.

Your mileage may vary...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Code to UML