refactoring: graph of import dependencies?

We’ve got three packages that, over time, have become inter-dependent to the extent that all three have to be compiled simultaneously to resolve dependencies (i.e. you cannot compile one, then add it’s output to the next and compile that, etc - you cannot compile any without having the source or precompiled versions of the others!).

This begs to be refactored, but each package has around 30 classes with very non-trivial interdependencies.

Every class only importst what it absolutely has to (eclipse’s auto import-management), so if I could get a graph showing exactly which classes had import dependencies on external packages I could relatively quickly make decisions on package-level refactoring (should we collapse into one package? Could we split into 2? 3? 4? etc).

Has anyone seen a free tool that will do this? I’ve got a nagging feeling I’ve seen it in a UML editor before (assuming correct class diagrams with explicit package delimiting, it would be theoretically possible for a UML editor to abstract out only the dependencies, and generate the graph I’m looking for), but can’t remember where.

It would be very useful for refactoring large projects. I’ve got a horrible feeling it might only be available in large commercial pacakges :(.

Try this

http://metrics.sourceforge.net/

[quote]Try this

http://metrics.sourceforge.net/
[/quote]
You have to read most of the way down the page until you get to the good parts.

Unfortunately, it’s eclipse v3 only :frowning: :frowning: :(. And the debian maintainers are still (3 months after 3 went live) faffing about failing to upgrade their packages. Grr.

But…this is the coolest (free) tool I’ve seen in bloody ages. Assuming it works, that dependency graph is just waht I’ve been looking for! For system-arch work, it’s perfect. Thanks!

[quote]Try this

http://metrics.sourceforge.net/
[/quote]
Sob! This doesn’t work - at all - on eclipse 3, fresh virgin install with JDT etc. It apparently only works on Eclipse 3.0 M8.

So…now I’m still looking for a tool, but hopefully one that actually works and isn’t Eclipse-2 only (which would make me very sad having just spent more than 3 fscking hours getting eclipse 3 to work just to try and use this tool).

EDIT: Ah, actually, one of the developers cleverly disabled the only documented way you could enable the metrics. There is also a bug so that the the secondary method doesn’t work in 2 cases out of 3. Eventually, mainly through pure luck, I discovered the one way of getting it to run (although all the documentation on the site, and in the plugin, is wrong and won’t work if you try and follow it).

Unfortunately, for no apparent reason, the dependency graph never works. So, I’m still looking for a tool that works :(.

EDIT2: The same developer has hard-coded the dependency graph to be windows-only. What a moron! He writes a java-tool plugin for a java IDE in java, and he hardcodes it to only run on MS-windows. And despite admitting to that mistake 3 months ago, he hasn’t got around to fixing it.

I installed Metrics in my Eclipse 3.0 on Debian Sarge from this link http://metrics.sourceforge.net/update by going via Help - Software updates - Find and install and adding the above site as a new remote site. Everything seems to work ok for me after I enabled metrics for the project in the project properties and then rebuilt the project.

Best regards,
Joakim

[quote]I installed Metrics in my Eclipse 3.0 on Debian Sarge
[/quote]
You’re saying that the dependency graph which according to the developer doesn’t work except on windows is actually working on debian for you?

EDIT: I’m using debian too, so ought to be able to do anything you can do…although of course because the debian maintainer still hasn’t packaged eclipse 3.0, I’m now running a manually installed copy of eclipse, so dependencies are a little less certain.

At least I got a graph that looked like the screenshots on the homepage. I could click around the different packages and the graph was updated.

I also use a manually installed Eclipse for the same reason.

have a look at refactorit.
http://refactorit.com.
iirc, the free version gives you the possibility to work with 50 classes max, which might be okay for you.

[quote]At least I got a graph that looked like the screenshots on the homepage. I could click around the different packages and the graph was updated.

I also use a manually installed Eclipse for the same reason.
[/quote]
Argh. So, it does work, contrary to the author’s support messages. But we don’t know why. Shrug. I give up. Clearly, this is software that could break at any moment (c.f. the last few versions - has and does), so even if I managed to work out hte magic combination to make it work it’s probably going to die on me at some critical point in the future :P. Thanks anyway.

[quote]have a look at refactorit.
http://refactorit.com.
iirc, the free version gives you the possibility to work with 50 classes max, which might be okay for you.
[/quote]
Thanks. However…50 is just too small :(. Ah well. Guess I just have to keep searching…