diff --git a/docs/JDepend.html b/docs/JDepend.html index bfcb1fb..c750fe1 100755 --- a/docs/JDepend.html +++ b/docs/JDepend.html @@ -6,7 +6,7 @@ JDepend - @@ -31,7 +31,7 @@ text-decoration: underline; } - div#title { + div#title { color: white; background: #000090; font-size: 150%; @@ -90,7 +90,7 @@ font-size: 0.8em; text-align: center; margin-top: 3em; - } + } --> @@ -125,18 +125,12 @@ extensibility, reusability, and maintainability to manage package dependencies effectively.

-

-If you like this kind of automation, you'll love my book, - Pragmatic Project - Automation. - -

Table of Contents @@ -147,7 +141,7 @@
  • Why Use JDepend?
  • Downloading JDepend
  • Installing JDepend
  • -
  • Building and Testing JDepend
  • +
  • Building and Testing JDepend
  • Running JDepend
  • Graphical UI Navigation
  • Interpreting Dependency Cycles
  • @@ -164,11 +158,11 @@
    - + Overview

    @@ -184,32 +178,32 @@

  • Afferent Couplings (Ca)

    - The number of other packages that depend upon classes within + The number of other packages that depend upon classes within the package is an indicator of the package's responsibility.

  • Efferent Couplings (Ce)

    - The number of other packages that the classes in the package depend + The number of other packages that the classes in the package depend upon is an indicator of the package's independence.

  • Abstractness (A)

    - The ratio of the number of abstract classes (and interfaces) - in the analyzed package to the total number of classes in + The ratio of the number of abstract classes (and interfaces) + in the analyzed package to the total number of classes in the analyzed package.

    The range for this metric is 0 to 1, with A=0 indicating a - completely concrete package and A=1 indicating a completely + completely concrete package and A=1 indicating a completely abstract package.

  • Instability (I)

    The ratio of efferent coupling (Ce) to total coupling - (Ce + Ca) such that I = Ce / (Ce + Ca). This metric is + (Ce + Ca) such that I = Ce / (Ce + Ca). This metric is an indicator of the package's resilience to change.

    @@ -222,36 +216,36 @@

    The perpendicular distance of a package from the idealized line A + I = 1. This metric is an indicator of the package's - balance between abstractness and stability. + balance between abstractness and stability.

    - A package squarely on the main sequence is optimally balanced - with respect to its abstractness and stability. Ideal packages - are either completely abstract and stable (x=0, y=1) or completely + A package squarely on the main sequence is optimally balanced + with respect to its abstractness and stability. Ideal packages + are either completely abstract and stable (x=0, y=1) or completely concrete and instable (x=1, y=0).

    The range for this metric is 0 to 1, with D=0 indicating - a package that is coincident with the main sequence and + a package that is coincident with the main sequence and D=1 indicating a package that is as far from the main sequence as possible.

  • Package Dependency Cycles

    - Package dependency cycles are reported along with the hierarchical + Package dependency cycles are reported along with the hierarchical paths of packages participating in package dependency cycles.

  • - + Why Use JDepend?

    @@ -268,7 +262,7 @@ designs, and automatically check that the designs exhibit expected qualities while undergoing continuous refactoring. Refactoring will undoubtedly lead to some adjustment of these metrics as the shape of -the design changes. +the design changes.

    Measure Design Quality @@ -354,16 +348,15 @@

    - + Downloading JDepend

    -JDepend -2.9 is the latest major version release. It includes all the +JDepend 2.10 is the latest major version release. It includes all the minor version changes.

    @@ -374,11 +367,11 @@

    - + Installing JDepend

    @@ -433,11 +426,11 @@

    - + Building and Testing JDepend

    @@ -470,7 +463,7 @@

    The JDepend distribution includes JUnit -test cases to validate the integrity of JDepend. +test cases to validate the integrity of JDepend.

    To test JDepend, use: @@ -486,11 +479,11 @@

    - + Running JDepend

    @@ -516,7 +509,7 @@

    For example, to analyze all the Java class files in the -$JDEPEND_HOME/build directory, use: +$JDEPEND_HOME/build directory, use:

    @@ -549,7 +542,7 @@

    For example, to analyze all the Java class files in the -$JDEPEND_HOME/build directory, use: +$JDEPEND_HOME/build directory, use:

    @@ -595,7 +588,7 @@

    For example, to analyze all the Java class files in the -$JDEPEND_HOME/build directory, use: +$JDEPEND_HOME/build directory, use:

    @@ -642,8 +635,8 @@

    This will create a docs/jdepend-report.dot file. If -you have Graphviz installed, you can then convert that .dot file -into a .png file using: +you have Graphviz installed, you can then convert that .dot file +into a .png file using:

    @@ -659,8 +652,8 @@ -->
    - -Graphical UI Navigation + +Graphical UI Navigation

    The graphical user interface displays the afferent and efferent @@ -736,15 +729,15 @@ For the epayment.adapters package, we see that it depends upon 4 other packages: the com.abc.epayment, com.xyz.epayment, -epayment.framework, and the epayment.response -packages. Furthermore, it's completely concrete (A=0) and completely -instable (I=1). This balance earns it a spot squarely on the main +epayment.framework, and the epayment.response +packages. Furthermore, it's completely concrete (A=0) and completely +instable (I=1). This balance earns it a spot squarely on the main sequence (D=0). We can conclude from these metrics that dependencies on this package are undesirable because it's both dependent and irresponsible. It's sensitive to modifications made to any of it's efferent couplings and -not accountable to any other package. Therefore, it's important that other -packages in the system not become dependent on this package, as they'll in turn -become fragile by any modifications made to the details of the +not accountable to any other package. Therefore, it's important that other +packages in the system not become dependent on this package, as they'll in turn +become fragile by any modifications made to the details of the epayment.adapters package and its dependencies. As a concrete package, it's not capable of being extended without being modified.

    @@ -815,8 +808,8 @@ -->
    - -Interpreting Dependency Cycles + +Interpreting Dependency Cycles

    Package dependency cycles are best observed using the textual or XML @@ -876,11 +869,11 @@

    - + Customizing JDepend

    @@ -938,13 +931,13 @@

    JDepend will ignore all package names specified as values to the -ignore property name prefix in the -jdepend.properties file. By default, no packages are filtered. +ignore property name prefix in the +jdepend.properties file. By default, no packages are filtered.

    The following example jdepend.properties file will ignore all package names prefixed by java, javax, -sun, com.sun, and the package +sun, com.sun, and the package com.xyz.tests:

    @@ -964,7 +957,7 @@

    The following example will ignore all package names prefixed by java and javax, in addition to any -package filters specified in an existing +package filters specified in an existing jdepend.properties file:

    @@ -1000,13 +993,13 @@

    Packages that are not expected to change can be specifically configured with a volatility (V) value in the -jdepend.properties file. -V can either be 0 or 1. If V=0, meaning the package is not at -all subject to change, then the package will automatically fall +jdepend.properties file. +V can either be 0 or 1. If V=0, meaning the package is not at +all subject to change, then the package will automatically fall directly on the main sequence (D=0). If V=1, meaning that the package is subject to change, then the distance from the main -sequence is not affected. By default, all packages are -configured with V=1. +sequence is not affected. By default, all packages are +configured with V=1.

    For example, a package like java.lang is generally not @@ -1042,7 +1035,7 @@ javaLang.setVolatility(0); // or JavaPackage javaLang = new JavaPackage("java.lang", 0); - + JDepend jdepend = new JDepend(); jdepend.addDirectory("/path/to/classes"); jdepend.addPackage(javaLang); @@ -1074,12 +1067,12 @@

    - -Using JDepend With JUnit + +Using JDepend With JUnit

    In the spirit of automation, metrics can be automatically collected by @@ -1125,35 +1118,35 @@ } protected void setUp() throws IOException { - + jdepend = new JDepend(); - + jdepend.addDirectory("/path/to/project/util/classes"); jdepend.addDirectory("/path/to/project/ejb/classes"); jdepend.addDirectory("/path/to/project/web/classes"); } - + /** * Tests that the package dependency constraint * is met for the analyzed packages. */ public void testMatch() { - + DependencyConstraint constraint = new DependencyConstraint(); JavaPackage ejb = constraint.addPackage("com.xyz.ejb"); JavaPackage web = constraint.addPackage("com.xyz.web"); JavaPackage util = constraint.addPackage("com.xyz.util"); - + ejb.dependsUpon(util); web.dependsUpon(util); - - jdepend.analyze(); + + jdepend.analyze(); assertEquals("Dependency mismatch", true, jdepend.dependencyMatch(constraint)); } - + public static void main(String[] args) { junit.textui.TestRunner.run(ConstraintTest.class); } @@ -1185,40 +1178,40 @@ } protected void setUp() throws IOException { - + jdepend = new JDepend(); - + jdepend.addDirectory("/path/to/project/ejb/classes"); jdepend.addDirectory("/path/to/project/web/classes"); jdepend.addDirectory("/path/to/project/thirdpartyjars"); } - + /** * Tests that a single package does not contain * any package dependency cycles. */ public void testOnePackage() { - + jdepend.analyze(); - + JavaPackage p = jdepend.getPackage("com.xyz.ejb"); - - assertEquals("Cycle exists: " + p.getName(), + + assertEquals("Cycle exists: " + p.getName(), false, p.containsCycle()); } - + /** - * Tests that a package dependency cycle does not + * Tests that a package dependency cycle does not * exist for any of the analyzed packages. */ public void testAllPackages() { - + Collection packages = jdepend.analyze(); - - assertEquals("Cycles exist", + + assertEquals("Cycles exist", false, jdepend.containsCycles()); } - + public static void main(String[] args) { junit.textui.TestRunner.run(CycleTest.class); } @@ -1251,51 +1244,51 @@ } protected void setUp() throws IOException { - + jdepend = new JDepend(); - + jdepend.addDirectory("/path/to/project/ejb/classes"); jdepend.addDirectory("/path/to/project/web/classes"); jdepend.addDirectory("/path/to/project/thirdpartyjars"); } - + /** - * Tests the conformance of a single package to a - * distance from the main sequence (D) within a + * Tests the conformance of a single package to a + * distance from the main sequence (D) within a * tolerance. */ public void testOnePackage() { - + double ideal = 0.0; double tolerance = 0.125; // project-dependent - + jdepend.analyze(); - + JavaPackage p = jdepend.getPackage("com.xyz.ejb"); - assertEquals("Distance exceeded: " + p.getName(), + assertEquals("Distance exceeded: " + p.getName(), ideal, p.distance(), tolerance); } - + /** - * Tests the conformance of all analyzed packages to a + * Tests the conformance of all analyzed packages to a * distance from the main sequence (D) within a tolerance. */ public void testAllPackages() { - + double ideal = 0.0; double tolerance = 0.5; // project-dependent - + Collection packages = jdepend.analyze(); - + Iterator iter = packages.iterator(); while (iter.hasNext()) { JavaPackage p = (JavaPackage)iter.next(); - assertEquals("Distance exceeded: " + p.getName(), + assertEquals("Distance exceeded: " + p.getName(), ideal, p.distance(), tolerance); } } - + public static void main(String[] args) { junit.textui.TestRunner.run(DistanceTest.class); } @@ -1309,8 +1302,8 @@ -->

    - -Using JDepend With FitNesse + +Using JDepend With FitNesse

    Writing JUnit tests to detect unwanted dependencies and package cycles @@ -1366,14 +1359,14 @@ the util component, then the cells containing an X would be colored green. Any other unexpected component dependencies, such as the ejb component depending on the web -component, would result in the corresponding cell turning red. +component, would result in the corresponding cell turning red.

    Cycles result in all corresponding cells within the cycle to turn red and be marked with the word 'cycle'. The fixture sports other handy features, as well. Refer to Bob's blog for detailed usage information. +target="_parent">Bob's blog for detailed usage information.

    The

    - + Using JDepend With Ant

    @@ -1458,7 +1451,7 @@ </jdepend> <style basedir="docs" destdir="docs" - includes="jdepend-report.xml" + includes="jdepend-report.xml" style="${ant.home}/etc/jdepend.xsl" /> </target> @@ -1467,11 +1460,11 @@

    - + Limitations

    @@ -1529,37 +1522,17 @@ - -

    -Donate - -
    -

    -Please support the development of JDepend by purchasing a copy -of the book Pragmatic Project -Automation. -

    -

    -Thanks! -

    -
    - + License

    -JDepend is licensed under the -BSD License. +JDepend is licensed under the MIT License.

    - + Acknowledgments

    @@ -1584,7 +1557,7 @@ -->

    - + Resources