- Introduction
- Installation
- Quick Start
- Icon Description
- Sample Screenshots
- Plugin-in SPI
- CDA API
- Release Notes
- Planned Features
- License
- Credits
- Feedback
- Download Page
The purpose of this tool is to analyze Java™ class files in order to learn
more about the dependencies between those classes.
A major strength of
CDA is that it can analyze on different levels:
It is capable of finding the dependencies of
- a single class
- all classes in one package
- all classes in one container (i.e. Java Archive or file directory)
And on the result side it is the same. The dependencies can be shown on
- class level
- package level
- or container level
Apart these already quite nice features it is possible to show
- all dependencies
- only direct dependencies
- or only indirect dependencies
on each level mentioned above.
Last but not least a popup menu on any class in the result table allows to
start the dependency path tracker. This tracker creates a graphical view of dependency paths
that lead from the analyzed class to the class currently selected in the result table.
This feature is very helpful if one wants to find out the best point
to break a dependency.
- Unzip the archive pf-cda-x.x.zip to any directory you want to have CDA located in.
- Then ensure that environment variable JRE_HOME or JAVA_HOME is set to a Java Runtime
Environment 1.8.0 or higher.
- As an alternative to the environment variables you can modify the cda.bat or cda.sh
to do java execution as you prefer on your machine.
To start the Class Dependency Analyzer just execute the
cda.bat (or
cda.sh).
Currently there are no command-line options available. All possible customization
are to be defined utilizing the properties of file
config/cda.properties.
After the main window was opened you need a
workset.
In a
workset you typically specify all elements of a
Java classpath that you want to analyze.
To start with your own
workset select the menu item
. That starts a wizard you can use to create
a new
workset which refers to classes you want to analyze.
As an alternative you can use the example
workset (worksets/CDA.ws)
to learn more about the tool's capabilities.
To do this, select menu item . In the succeeding
file selection dialog go to the folder where you installed
CDA.
From there move to sub folder
worksets and open workset file
CDA.ws.
This example
workset contains all CDA JAR files.
After opening it you will see the workset on the left in the tree view. Here you may select any child element
and analyze it using either the popup menu or the accelerator key
Alt+D.
Since analyzing can last a while a progress monitor window pops up. It shows how many
classes of all classes in the workset have been analyzed so far. Though usually not all classes have to be
analyzed for one dependency detection process it is still recommended to wait until all loaded
classes are analyzed.
Find here a brief description of each icon that is used in
CDA:
|
A Workset. |
|
This represents a dummy container which doesn't exist in reality. All classes
and interfaces that have been referred to but cannot be found in any container
of the workset are assigned to this dummy container.
|
|
Class container (i.e. a Java Archive or a file directory containing class files)
This class container has been found and its content can be loaded into memory.
|
|
An element that has been specified in the classpath but could not be found or
cannot be loaded into memory.
|
|
A Java package that has not yet been checked for its contained classes.
|
|
A Java package that has been checked already for its contained classes.
|
|
A class file that has not yet been loaded. Thus it is not
clear whether it contains a Java class or interface.
|
|
A class file that cannot be found or was corrupt so it could not
be loaded into memory.
|
|
A Java class that is part of the current workset and has been
loaded into memory.
|
|
A Java class with a main() method that is part of the current workset and
has been loaded into memory.
|
|
A Java interface that has been referred to but cannot be found and therefore
is not in memory.
|
|
A Java interface that is part of the current workset and has been
loaded into memory already.
|
|
A Java annotation that is part of the current workset and has been
loaded into memory already.
|
|
A Java enum that is part of the current workset and has been
loaded into memory already.
|
A table that shows all classes and interfaces the class ClassTableModel depends on.
Shows all dependency paths from class RepeatedTest to TestListener.
Sub-Window that shows all classes that depend on TableEditorModel
Since version
1.9.1 CDA supports a plug-in mechanism that allows
developers to add their own custom extensions to the tool.
Therfore the open source component
Object Dependency Exploration Model (ODEM)
was created to define an independent object model for dependency analyzers. The Javadoc of
ODEM is included in the
Extension SPI Javadoc.
Beside the
Javadoc for the
CDA
plug-in SPI the
developer guide and a sample implementation (inluding source code)
should make it very easy to develop your own plug-in.
Adding a plug-in to
CDA is just as simple as to follow these few steps:
- Create a subclass of one of the extension-points (these are abstract classes)
- Declare the plug-in in a (new) file META-INF/ui.plugins
- Bundle all that together in a JAR file and copy it to ${CDA_HOME}/lib/ext
- Restart CDA
Since version
1.15.0 the
CDA core implementation classes
are documented via
Javadoc and a section in the
developer guide helps with utilizing
CDA without its GUI.
There's also a
guide that helps with exporting dependencies to external files programatically.
Current version of
CDA is
2.8.0.
It requires at least
Java 8 to be executed. Should work with java 9 to 13 as well.
Have a look at
release-notes.txt for details or get
a quick overview of the most important changes below.
V2.8.0
- Optionally calculating hashes for all analyzed classes and containers
V2.7.2
- Performance improvement: fixed undesired closing of archive containers
- Fixed undetected dependency on generic type in local variables
- Analysis of spring beans configurable (enable/disable)
V2.6.0
- Support Spring Boot loader JARs
- Ignore "module-info.class" files for minimum required java version calculation
- Showing different images for different container types in overview panel
- Upgrade to Apache BCEL 6.4.1 due to bugfix BCEL-328 (EmptyStackException)
V2.5.0
- Improved EAR file handling for WebLogic special folders /lib, APP-INF/classes and APP-INF/lib.
- Bugfix: Open resources from extracted archive folder rather than from archive directly
- Upgraded to Apache BCEL 6.4.0
V2.4.1
- Bugfix for not unique nameSuffix in *.ws files for some use cases
- Bugfix for files not being removed from temp folder if loaded workset gets edited and saved/accepted
V2.4.0
- Moved UI related plugin from PF-CDA-Extensions to new component PF-CDA-UI-Extensions
- Added guide on how to export dependencies programatically
- Bugfix: NPE at org.pfsw.nls.NLSIniFileLoader.loadText(NLSIniFileLoader.java:123) at start with Java version > 8
- Bugfix: ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageEncoder with Java version > 8
V2.3.0
- In WAR files ignoring class files under WEB-INF/lib and sub-folders
- In WAR files ignoring JAR files files under sub-folders of WEB-INF/lib
- Ensured that dependencies are first looked for in own container and only if not found there in other containers.
- Added class file versions for Java 10-13
V2.2.0
- Optional inclusion of resources files
- Improved clean-up of temporary files
- pf-cda-extesions.jar gets now added to the distribution bundle, which enables exporting of dependencies to an XML ODEM file
- New display scope option "N/A" in dependency table view to show only classes/packages/containers that have not been found (not resolved)
- Loading now all JARs from inside a WAR file, not only those that are under WEB-INF/lib
V2.1.0
- Support for EAR files
- Support for OSGi bundles
- Default alias names for containers
- Detection of circular dependencies
V2.0.0
- Support for WAR files
- Exclude patterns in filter definitions
- Bugfix: java.lang.ClassCastException: org.pf.tools.cda.base.model.ClassInformation cannot be cast to java.util.List
V1.16.0
- Supporting mouse wheel for scrolling and zooming
- Bugfix for detection of invalid class names
- Bugfix for exceptions that prevented analyzing Java 8 classes with lambda expressions
V1.15.0
- New filter in graphs to show only inheritance dependencies
- Javadoc package for core CDA implementation classes
- New section in CDA Developer Guide for programmatic CDA usage
- Programmatic-CDA.zip with sample code for programmatic CDA usage
V1.14.0
- In graph views the popup menu of visible elements now provides a new menu item: "Add dependants"
- In graph views the popup menu of visible interfaces now provides a new menu item: "Add implementors"
- It is now possible to specify alias names for containers
- An experimental decompiler
- Dialog sizes have been adjusted to a reasonable size
V1.13.1
- Updated libraries from JGoodies for better Windows 7 support
V1.13
- Added support for PNG and BMP file export
- New function that allows to find ALL dependants of any element in the tree view
- Improved classpath definition in the workset wizard
- Bugfix: Problem with starting CDA under Linux due to properties file loading error
V1.12
- New feature that allows to look-up all classes that implement a static main(String[]) method.
- Clicking on a disabled "Dependency" tab automatically executes the "Analyze Dependencies" action.
- Versions determined from manifest files are shown in tree view for class containers.
- Bugfixes
V1.11
- Introduced the Dependency Analyzer Remote Control (DARC)
- Bugfixes
V1.10
- Package of ODEM has changed to org.pfsw.odem
- All DTD files (workset-1.6.dtd, odem-1.1.dtd) are now declared by a public logical name and a URI that points to the file location in the web.
- CDA now supports ODEM/XML (export) files in a workset's classpath.
- Re-initialization of workset has been changed to be executed only when needed.
- A progress monitor window is shown now during the whole initialization process of a workset.
- Bugfixes
V1.9
- Well documented plug-in API (including ODEM)
- Find dependants (for all levels)
- Find duplicate classes in a workset
- N/A container for all classes that have not been found
- Showing class file version and minimum required JVM version
- For most table views a graph view can be opened via toolbar button
- Requires JRE 1.5
V1.8.x
- More details (visibility, abstract, final) about classes
- Many new graph views on all levels (i.e. class, package, container)
- Drag & Drop support to add elements from tree to graph view
- Detailed list of class dependencies that cause dependencies between packages or between containers
- Statistics aubout number of classes, packages, containers
- Improved navigation (direct jump to element in tree vew)
- Container's display names can now be shortened
V1.7
- New graph library (yFiles)
- Auto-Layout
- Zooming
- Printing
- Saving to JPG, GIF or GML
V1.6
- Support of Java 5 annotations, enums and generic types
- Performance tuning: Up to 5 times faster than V1.5
- Search feature to find all implementors of an interface
- Search feature to find dependants of a class, an interface, an annotation or an enum
The following list presents some of the features that are planned for future versions.
- Support for Java 9 modules
- Deriving dependencies from Spring beans declarations
- Capability to define components (or modules) as a set of packages.
- Verification of a workset against a defined component model
- Calculation of some metrics
- Saving graph view as TGF, XGML
- Hiding of containers in the tree view, so that only packages are visible on the first level.
- Support Ivy dependency definitions in classpath
- Support Maven dependency definitions (pom.xml) in classpath
- XML Export for dependency and search result tables
- Java decompiler
This tool is currently available under the terms of the follwing
license. It grants the right to freely use and
share this tool.
However, the source code is
not available for download on the
Programmer's Friend website. Only the binaries are free.
At this place I want to thank all open source programmers who created great Java
libraries that enabled me to efficiently build
CDA on top.
Currently
CDA uses the following open source libraries:
Also I want to thank yWorks. They allowed me to use free of charge promo version of their great graph library yFILES.
Please send all bug reports, comments and suggestions to
feedback@programmers-friend.org.