Re: Export all classes in call graph?
- From: Thomas Weidenfeller <nobody@xxxxxxxxxxxxxxxx>
- Date: Thu, 16 Jun 2005 09:51:44 +0200
Robert Mischke wrote:
With "call graph" I mean the set of all classes that may be directly or indirectly used from classes you specify.
A call graph works on method-level, not class level (often, for the purpose of a call graph, constructors are also treated as methods). A call graph indicates which methods (of which classes) are used (are "called") by other methods, not just which classes somewhat dependent on each other.
You are probably after compile-time dependency or class dependency, not a call graph.
In the example below, B and C are in the call graph of A, while D is not.
"in the call graph of A" has no meaning. You probably mean "children of A".
> In Java, the call graph can be easily found by following the
"import" statements, as long as they are accurate and don't use "*"s (because this also includes classs that are not neccesarily in the call graph).
This is absolutely wrong. Import statements introduce a compile-time dependency, but not necessarily a class dependency. And, if no method is used from the imported class, the imported class would also have no business in showing up in a call-graph.
import A;
/** never uses A **/
class B {
int ten() { return 10; }
}You can only compile this, when A is in the CLASSPATH (compile-time dependency), but you can change A as much as you like without having an influence on B (no class dependency). And since B uses nothing of A, no method of A would ever appear as a children of a method of B in a call-graph.
/Thomas
-- The comp.lang.java.gui FAQ: ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq .
- Follow-Ups:
- Re: Export all classes in call graph?
- From: Robert Mischke
- Re: Export all classes in call graph?
- References:
- Export all classes in call graph?
- From: Robert Mischke
- Re: Export all classes in call graph?
- From: Lucy
- Re: Export all classes in call graph?
- From: Robert Mischke
- Export all classes in call graph?
- Prev by Date: Re: Export all classes in call graph?
- Next by Date: Re: Export all classes in call graph?
- Previous by thread: Re: Export all classes in call graph?
- Next by thread: Re: Export all classes in call graph?
- Index(es):
Relevant Pages
|