添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Classycle: Analysing Tools for Java Class and Package Dependencies

Classycle's Analyser analyses the static class and package dependencies in Java applications or libraries. It is especially helpful for finding cyclic dependencies between classes or packages. Classycle is similar to JDepend which does also a dependency analysis but only on the package level. Classycle's Dependency Checker searchs for unwanted class dependencies described in a dependency definition file. Dependency checking helps to monitor whether certain architectural constrains (e.g. in a layered architecture) are fulfilled or not. For an Eclipse plugin see Alain Graf's ClassyclePlugin

Purpose and Features

Static cyclic dependencies of classes or packages can be a sign of bad object-oriented design. A static dependency is a dependency between classes or packages. It can already be detected by the compiler. This has to be distinguished from dynamic dependency which is a dependency between objects . Figuring out static cyclic dependency is the main purpose of Classycle. Classycle does not need the Java source files because it analyses the compiled class files. Since version 1.3 it also evaluates Java Generics signatures. From the analysis of the class files directed graphs of class and package dependencies are calculated. These graphs are further analysed in order to detect cyclic dependencies. For more details, see the User Guide Chapter 2. How Classycle works . Classycle's Analyser produces a report (in XML) which contains

  • the complete directed class/package graph
  • all strong components of the class/package graph with more than one vertex (i.e. cycles of class/package dependencies) In addition it groups the classes/packages into layers. For each class/package the layer index is reported. For more details, see the User Guide Chapter 3. What Classycle measures . There is also an XSL transformation for rendering the XML report into an HTML page. Based on the class graph Classycle's Dependency Checker allows to search for unwanted dependencies between two sets of classes. An unwanted dependency between the start set and the end set can be either

    • a direct one (a class of the start set uses a class of the end set) or
    • an indirect one where a path goes via intermediate classes from a class of the start set to a class of the end set. If such dependencies are found all or only the shortest paths are reported. Instead of unwanted dependencies also allowed dependencies can be defined. In addition the Dependency Checker can check the absence of large class cycles or package cycles. Classycle tools can be run on the command line as well as an Ant task. Command line options and Ant task attributes are explained in the first chapter of the User Guide.

      Release History

      Classycle 1.4.2

      This is a minor release from 11/1/2014.

      Bug fixes:
    • Java 8 lambda expressions are supported.

      New Features:
    • In Classycle Ant tasks zipfilesets can be used. This feature is partially based on a patch by Tom Denley.
      Bug fixes:
    • Bug #3562457 fixed: Checking with 'dependentOnlyOn' printed expanded set definitions in the output. Now it prints only the set definitions as in the other check commands.
    • New Dependency Checker command: dependentOnlyOn
    • New renderer of dependency checking result: classycle.dependency.XMLResultRenderer
    • New attribute reportFile of DependencyCheckingTask allows to write the dependency checking result into a file.
    • The source of an analyzed classes and packages are added to the report.
    • All zip/jar/war/ear files in folders are also analyzed. Both features are based on a patch provided by Dietmar Wolz.

      Classycle 1.3.2

      This is a minor release from 3/17/2008.

      Bug fixes:
      • Bug #1892622 fixed: The bug appeared in the package dependency graph if a package contains external and internal classes.
        • Now a package classifies as an internal package if it contains at least one internal class.
        • An arc in the class graph from an internal class to an external class do not imply a corresponding arc between their packages if the package of the external class is an internal package.

          New Features:
          • Evaluates Java Generics signatures.
          • Better syntax checking concerning miss-spelled keywords in dependency definition files.

            New Features:
            • Merging inner classes: All inner classes vertices can be merged with their outer class vertex.
            • New commands for the Dependency Checker:
              • Property definition and use
              • Checking sets
              • Checking absence of large class or package cycles
                • XML report:
                  • Date attribute in root element filled with current date.
                  • Class/package element: Attribute cycle which denotes the cycle to which the class/package belongs.
                  • reportXMLtoHTML.xsl:
                    • Sorts the cycles lists in accordance to their size.
                    • Links to cycles for classes/packages belonging to a cycle.

                      New Features:
                      • Ordinary string constants in Java code can be used as class references if they are valid fully-qualified class names and match certain patterns (see first chapter of the User Guide).
                      • Dependency Checker.
                        Documentation:
                        • Adapted to the new feature initial version!
                        • Many methods of class Analyser become public in order to be used by other Java classes (e.g. ReportTask ).
                        • New command line option: -includingClasses and -excludingClasses (see first chapter of the User Guide).
                          Bugfixes:
                          • XML escaping of the title of the XML report
                            Documentation:
                            • Adapted to the new feature
                            • New with API documentation
                              • Package dependencies and cycles
                              • Improved reportXMLtoHTML.xsl generates class/package links in popup windows.
                                Documentation:
                                • Adapted to the new feature

                                  New Features:
                                  • Calculates and reports maximum fragmentation size for all classes of a cycle.
                                    Documentation:
                                    • Adapted to the new feature
                                    • New chapter: Hints to improve design Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle in the U.S. and other countries. (C) 2003-2014 Franz-Josef Elmer . All rights reserved. Last modified: 11/1/2014