Computes transitive closure in a dependency graph from a given starting point.
This tool takes a dependency graph generated by
DependencyExtractor and follows a trail
of dependencies to construct a subgraph of all dependencies related to a
starting point. The result is a new dependency graph which is a subgraph of
the original one. You can use the various XXXToText
and
XXXToHTML
XSL transformations to render the graph as text or HTML
for human reading.
You can limit the number of hops downstream, along outbound dependencies,
with maximumoutbounddepth
. You can limit the number of hops
upstream, along inbound dependencies, with maximuminbounddepth
.
By default, the tool will go as far as possible along outbound dependencies
without visiting any element twice.
One limitation: the graph must be maximized for anything other than feature-to-feature queries. Because of a limitation in the closure computation, it does not detect implicit dependencies and only follows dependencies that have been made explicit.
With the serialize
attribute, it serializes the entire
dependency graph with Java serialization.
With the xml
attribute, it converts the entire dependency
graph into an XML document that follows the
DTD.
Attribute | Description | Required |
srcfile | filename of the XML document containing the dependency graph. | Yes |
validate | validate the input XML against its DTD. | No |
destfile | where to write the output. If the file does not exists, it is created. If it already exists, its content is overwritten. | Yes |
scopeincludes | the name of a package, class, or feature must match the regular expressions for it to be included in the query's focus. | No |
scopeexcludes | the name of a package, class, or feature must NOT match the regular expressions for it to be included in the query's focus. | No |
packagescope | select packages as part of the query's focus. | No |
packagescopeincludes | the name of a package must match the regular expressions for it to be included in the query's focus. | No |
packagescopeexcludes | the name of a package must NOT match the regular expressions for it to be included in the query's focus. | No |
classscope | select classes (with their package) as part of the query's focus. | No |
classscopeincludes | the name of a class must match the regular expressions for it to be included in the query's focus. | No |
classscopeexcludes | the name of a class must NOT match the regular expressions for it to be included in the query's focus. | No |
featurescope | select features (with their class and package) as part of the query's focus. | No |
featurescopeincludes | the name of a feature must match the regular expressions for it to be included in the query's focus. | No |
featurescopeexcludes | the name of a feature must NOT match the regular expressions for it to be included in the query's focus. | No |
filterincludes | the name of a package, class, or feature at the other end of the dependency must match the regular expressions for the dependency to be included in the results. | No |
filterexcludes | the name of a package, class, or feature at the other end of the dependency must NOT match the regular expressions for the dependency to be included in the results. | No |
packagefilter | show dependencies to and/or from packages. | No |
packagefilterincludes | the name of a package at the other end of the dependency must match the regular expressions for the dependency to be included in the results. | No |
packagefilterexcludes | the name of a package at the other end of the dependency must NOT match the regular expressions for the dependency to be included in the results. | No |
classfilter | show dependencies to and/or from classes. | No |
classfilterincludes | the name of a class at the other end of the dependency must match the regular expressions for the dependency to be included in the results. | No |
classfilterexcludes | the name of a class at the other end of the dependency must NOT match the regular expressions for the dependency to be included in the results. | No |
featurefilter | show dependencies to and/or from features. | No |
featurefilterincludes | the name of a feature at the other end of the dependency must match the regular expressions for the dependency to be included in the results. | No |
featurefilterexcludes | the name of a feature at the other end of the dependency must NOT match the regular expressions for the dependency to be included in the results. | No |
all | shortcut for packagescope ,
classscope , featurescope ,
packagefilter , classfilter , and
featurefilter . |
No |
p2p | shortcut for packagescope and
packagefilter . |
No |
c2p | shortcut for classscope and
packagefilter . |
No |
c2c | shortcut for classscope and
classfilter . |
No |
f2f | shortcut for featurescope and
featurefilter . |
No |
includes | shortcut for scopeincludes and
filterincludes . |
No |
excludes | shortcut for scopeexcludes and
filterexcludes . |
No |
serialize | writes the dependency graph as serialized Java objects. At this time, Dependency Finder cannot deserialize a saved graph, so this switch is pretty useless. | No |
xml | writes the dependency graph as an XML document with the
dependencies
DTD. |
No |
dtdprefix | prefix of the DTD URL for the XML output document.
Only useful with xml . |
No |
indenttext | used for each indentation level in textual and XML output. | No |
maximuminbounddepth | maximum distance to travel upstream by following inbound dependencies. If its value is zero (0), don't follow any inbound dependencies. If its value is omitted, or if it is not a number, than the traversal is unbounded. If the attribute is omitted, the closure will not follow any inbound dependencies. | No |
maximumoutbounddepth | Maximum distance to travel downstream by following outbound dependencies. If its value is zero (0), don't follow any outbound dependencies. If its value is omitted, or if it is not a number, than the traversal is unbounded. If the attribute is omitted, the traversal will be unbounded. | No |
None
To analyze the graph in df.xml
and compute the transitive
closure streaming from DependencyExtractor.main()
and save it to
de.closure.xml
:
<dependencyclosure srcfile="df.xml" destfile="de.closure.xml" p2p="yes"/>
To analyze the graph in df.xml
and trace back calls to
NodeFactory.CreateXXX()
up to three levels deep:
<dependencyclosure srcfile="df.xml" destfile="create.closure.xml" all="yes" scopeincludes="/NodeFactory.Create/" maximuminbounddepth="3" maximumoutbounddepth="0"/>
To analyze the graph in df.xml
and trace back calls to
NodeFactory.CreateXXX()
up to three levels deep, and then
convert it to HTML:
<dependencyclosure srcfile="df.xml" destfile="create.closure.xml" all="yes" scopeincludes="/NodeFactory.Create/" maximuminbounddepth="3" maximumoutbounddepth="0"/> <xslt style="${dependencyfinder.home}/etc/ClosureToHTML.xsl" in="create.closure.xml" out="create.closure.html"/>
Copyright © 2001-2003 Jean Tessier. All rights reserved.