0

I'm separating a module from a Java project (essentially creating a separate Java Project for the module). I've been spending a lot of time to figure out the class dependencies. What strategy/tool can I use to help speed up the process?

For example, if I know for sure that I need to extract out class A into the new project, how would I quickly identify all the classes on which class A depends for successful compilation.

Approaches tried:

At the moment, I'm going by repetitive cycles of: add required classes to new project -> compile -> gather necessary classes from original project based on compiler error message -> repeat.

Generating UML Class Diagrams is not working out as most UML reverse-engineering tools seem to have some limitation or the other when it comes to identifying inheritance, associations, etc. I already tried ArgoUML.

Community
  • 1
  • 1
mauryat
  • 1,610
  • 5
  • 29
  • 53
  • try generating a class heirarchy. Eclispe supports this: I suspect that any IDE will allow you to generate a class heirarchy. – DwB Jan 16 '15 at 17:24
  • Sorry, don't really understand your problem. Are you familiar with 'Find usages' in your IDE? – ponomandr Jan 16 '15 at 17:29
  • @ponomandr Find usages gives me the list of classes where my class is being referenced. However, I want the opposite. For example, to compile the `java.util.LinkedList` class, you'd need the `Iterator` class because it is referenced in the `LinkedList` class. Basically, I'd like to identify all such classes (`Iterator`, `ListIterator`, `Collection`, `NoSuchElementException`) referenced in the `LinkedList` class. – mauryat Jan 16 '15 at 19:26
  • @DwB Class hierarchy in Eclipse simply displays the inheritance structure. – mauryat Jan 16 '15 at 19:28

2 Answers2

1

It looks like you need "Dependency viewer" of Intellij IDEA.

Intellij IDEA Dependecy viewer

It can be found under Analyze > Analalyse Dependecies...

ponomandr
  • 1,523
  • 13
  • 21
0

In my experience, Eclipse has the best built-in utilities to get information about class dependencies and such. You could go into the debug view and trace each class and/or method.

Daniel Jamrozik
  • 1,228
  • 2
  • 11
  • 25