aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes reverse enginnering java project 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 "reverse enginnering java project" Watch "reverse enginnering java project" New topic
Author

reverse enginnering java project

shobhit garg
Ranch Hand

Joined: Mar 07, 2004
Posts: 42
Hi ,

I have a huge java project comprsisng of a number of packages.
I want to generate class diagrams ,sequence diagrams for the entire project.
Are there any tools/eclipse plugins available that can help, (i don't want to go to each and every file)?


Regards,
Shobhit
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
What will you do with those diagrams?


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
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I can imagine that it might be possible to generate class diagram(s) from source code, although they will very likely be completely unreadable if your project is as "huge" as you say.

What I can't imagine is that any software will be able to automatically generate sequence diagrams (a dynamic view of a system in operation) from source code (a static view of the components of a system).

I can only echo Ilja's comment: who needs these diagrams, and what do they hope to do with them?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
shobhit garg
Ranch Hand

Joined: Mar 07, 2004
Posts: 42
well its not that huge also in the first place ...
i just needed them to get a picture of how the classes
are interacting with each other ..nothing more
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
There are a number of static source code analysis programs that will show you how classes reference or depend upon one another. That might give you a starting point. I usually just scribble a class diagram of some sort with pencil & paper as I read code. Once in a while I run across somethign so complex I make a nice diagram and keep it. In my own code I consider that a design failure and try to fix it instead.


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
Darya Akbari
Ranch Hand

Joined: Aug 21, 2004
Posts: 1855
Hi Shobhit,

you and me and a lot of others belong to the group of people who prefer the visual learning style, because our brain like it this way. So don't get nervous, there is nothing wrong with you .

Look at EclipseUML from Omondo which is a free Eclipse plugin. Unzip the given ZIP file into your Eclipse directory. You can reengineer other's projects and get the visual overview you want .

Regards,
Darya


SCJP, SCJD, SCWCD, SCBCD
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Darya Akbari:
you and me and a lot of others belong to the group of people who prefer the visual learning style, because our brain like it this way.


While we need all the help that we can get, one needs to remember that tools are no panacea. Code can lie - mis-named classes and methods, mis-partitioned classes, etc. While I like to prepare diagrams of the system under work, the majority of the benefit comes from the code inspection, not the resulting diagram (in many cases I can toss the diagram once I'm done; model to understand). A reverse engineering tool would have to implement an AI capable beyond the mere writing of code in order to discover/intuit the intent of code. Most of the time you yourself will have to read the code to discover its intent. Reading code is as much part of our job as writing it and reading (other people's) code is a skill that can only be honed through practice (however painful it may be at times).

Reading code is such an important skill that Object Oriented Reengineering Patterns (amazon US) has a section called: PART I Reverse Engineering: 3.2 Read All the Code in One Hour.
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
ArgoUML is an open source UML tool.

Poseidon Community edition has a trial period. I feel that it is easier to use than ArgoUML.

Visio is useful for quick manual construction of UML diagrams.

Let me know if there are more good tools out there.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 671
Yes EclipseUML from Omondo (free edition) will do the trick. I used it to get the class diagrams.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Choudary Kothapalli
Greenhorn

Joined: Mar 20, 2007
Posts: 4
Hi Shobhit,

You may want to try MaintainJ, an Eclipse plug-in to generate runtime sequence and class diagrams for a use case. You can define the start and end points of a use case and generate the sequence diagram for all the object interactions for that use case. Check the demo on the web site.
[ March 20, 2007: Message edited by: Choudary Kothapalli ]

Regards,<br />Choudary Kothapalli.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
That's pretty neat. I'd thought about analyzing calls for this purpose with logs from a performance analyzer we used but never tried it. They've done a nice job of integrating with Eclipse. I wonder if you can tell it to leave out the Java library or other packages - it's easy to get buried in detail and lose the major abstractions.
 
Consider Paul's rocket mass heater.
 
subject: reverse enginnering java project