One tool I tried is umbrello, which at the first try worked nicely, then however crashed (maybe there was too much source code) and never launched. I have seen people commenting similar behavior with umbrello. ArgoUML is another java-based tool, which produced diagrams from my code, however hardly legible ones. Class names overlapped and were not readable at all.
Actually, if you just want to see the dependency of you classes, it should not be so difficult to generate. Dependency diagrams from source code can be made in a very simple way, by using a bash 3-line shell script and visualizing with graphviz (see my introduction to graphviz).
For C++, you just parse the header files and find "
class bar: public foo {." Then you parse this line and output to a file (here diagram.dot):echo "digraph G {"> diagram.dot
sed -n -e "s/class [ ]*\([a-zA-Z0-9_]*\)[ ]*:[ ]*public [ ]*\([a-zA-Z0-9_]*\)[ ]*[{][ ]*/\1 -> \2 ;/p" *.h >> diagram.dot
echo "}" >> diagram.dot
compile to pdf:
And finished. You can see the inheritance of your classes in the pdf. Note that this script -- as it is -- only handles single inheritance from public classes.
You can use very similar commands for Java:
echo "digraph G {"> diagram.dot
sed -n -e "s/class [ ]*\([a-zA-Z0-9_]*\)[ ]* extends [ ]*\([a-zA-Z0-9_]*\)[ ]*[{][ ]*/\1 -> \2 ;/p" *.java >> diagram.dot
echo "}" >> diagram.dot
Enjoy. Please leave a comment for questions or suggestions.
[ Read more... ]


