Page 1 of 1

Graphic tools to view dependencies between classes

Posted: Thu Jan 20, 2011 1:24 am
by matthijs
A big part of understanding and improving code is getting to know all the dependencies and the stuff going on "behind the scenes". Are there any graphical tools which can help map those dependencies in a library of existing code?

Currently I just read the code and make notes in a text file, writing down the empty class methods and noting which classes/methods they call, etcetera. Something like

Code: Select all

class Something {
	public function __construct($db);
	public function doSomething(); // calls SomeotherClass::dothis()
}
class Someotherclass {
	public function dothis();
}
you understand this is a lot of work. But it helps to get a better overview of a library of classes. For example, looking at a single class in isolation I might not notice anything wrong. However, seeing how things fit together in the bigger picture I might see that the naming is inconsistent, or that the dependency between A and B shouldn't be there, etc etc.

However, I'm sure it's a lot easier if some graphic UI could do all that work for me with the click of a button.

Re: Graphic tools to view dependencies between classes

Posted: Thu Jan 20, 2011 3:35 pm
by John Cartwright
A quick search showed this software as a potential: Poseidon for UML Professional Edition

See this article http://www.developer.com/design/article ... in-UML.htm

Hopefully thats what your after :drunk:

Re: Graphic tools to view dependencies between classes

Posted: Fri Jan 21, 2011 3:24 am
by matthijs
Thanks for the suggestion. Maybe this exact piece of software is not exactly what I'm looking for, but it is in the direction I'm looking for. And I have some new terms to use in my google search, I hadn't thought about "object diagrams" :banghead:

Re: Graphic tools to view dependencies between classes

Posted: Sat Jan 22, 2011 12:19 pm
by jarofgreen
You can use xdebug to make a full stack trace of what happens when a PHP script is called. Not graphical but you can use that to work out the code paths, what calls what and so on - bit easier than doing it by hand.

Re: Graphic tools to view dependencies between classes

Posted: Sat Jan 22, 2011 4:07 pm
by matthijs
Yeah, I thought about that as well, good suggestion. Hadn't figured out yet how to install xdebug but I should

Re: Graphic tools to view dependencies between classes

Posted: Sat Jan 22, 2011 8:29 pm
by josh
In neatbeans there's a way to jump to a class superclass, or popup a list of classes that subclass it. It also flags methods that are overloading or overload.