Programmer's Friend

Class Dependency Analyzer (CDA) 2.8.0

  1. Introduction
  2. Installation
  3. Quick Start
  4. Icon Description
  5. Sample Screenshots
  6. Plugin-in SPI
  7. CDA API
  8. Release Notes
  9. Planned Features
  10. License
  11. Credits
  12. Feedback
  13. Download Page

Introduction

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

And on the result side it is the same. The dependencies can be shown on Apart these already quite nice features it is possible to show 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.

Installation

Quick Start

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 File/New.... 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 File/Open.... 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.

Icon Description

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.

Sample Screenshots


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

Plug-in SPI

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:

  1. Create a subclass of one of the extension-points (these are abstract classes)
  2. Declare the plug-in in a (new) file META-INF/ui.plugins
  3. Bundle all that together in a JAR file and copy it to ${CDA_HOME}/lib/ext
  4. Restart CDA

CDA API

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.

Release Notes

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

V2.7.2

V2.6.0

V2.5.0

V2.4.1

V2.4.0

V2.3.0

V2.2.0

V2.1.0

V2.0.0

V1.16.0

V1.15.0

V1.14.0

V1.13.1

V1.13

V1.12

V1.11

V1.10

V1.9

V1.8.x

V1.7

V1.6

Planned Features

The following list presents some of the features that are planned for future versions.

License

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.

Credits

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.

Feedback

Please send all bug reports, comments and suggestions to .