Graphic tools to view dependencies between classes

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Graphic tools to view dependencies between classes

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Graphic tools to view dependencies between classes

Post 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:
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: Graphic tools to view dependencies between classes

Post 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:
jarofgreen
Forum Commoner
Posts: 71
Joined: Sun Jul 11, 2010 12:40 pm

Re: Graphic tools to view dependencies between classes

Post 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.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: Graphic tools to view dependencies between classes

Post by matthijs »

Yeah, I thought about that as well, good suggestion. Hadn't figured out yet how to install xdebug but I should
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Graphic tools to view dependencies between classes

Post 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.
Post Reply