This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

classes/methods diagram

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I'm new to Java but I was given a 300 classes system that I need to understand and modify. When I try to follow the logic I get lost, I even can't find in which class is defined the method that is called because each class imports many others.
It would help me very much if there could be some tool to build some kind of flowchart or classes diagram to visually show who calls who..
Posts: 3742
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UML (Unified Modeling Language) is the commonest method of describing Object Oriented Systems. There are tools available that will produce UML diagrams from existing code. Google UML Tools to see what's available.
Ranch Hand
Posts: 132
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it would help if you use a UML diagramming tool such as "MagicDraw UML" or "Smart Draw". I personally prefer MagicDraw. You can download a trial version from, if I am not mistaken.
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're not familiar with UML, here's a great introduction to The Diagrams of UML 2 from Scott Ambler. I'll mention three that might be good starting points.

The Class Diagram shows how classes are related to each other. For example one might extend another, or one might have a reference variable whose type is another class. This is a good "static" view of how things are constructed.

The Communication and Sequence diagrams really contain the same information in different formats. Communication does a better job of showing some of the same relationships that were in the Class diagram. Sequence shows what things happen in what order better.

I often doodle Communication or Sequence diagrams on a piece of paper while reading complicated code. In rare cases I transcribe these to a tool for safe keeping or easier editing. So 1) learn a few of the diagrams, not all 13 on that list, 2) make a few on paper or a whiteboard, 3) worry about drawing tools.

You can probably find a tool that will read Java and draw the class diagram. I have rarely found this useful, as they show so much detail that they hide the important bits. Your mileage may vary.

Oh, what IDE do you use? In Eclipse I often highlight a method call and hit F3 to see where it's defined. I also have a plug-in that helps find implementations in case F3 lands you on an Interface.

Keep it fun, let us know how it goes!
[ August 17, 2007: Message edited by: Stan James ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!