My experience is that almost every projectwith more than 500 classes has unwanted dependencies between its modules (module = coherent set of packages). Often even cycles between modules occur.
There are some Open-Source solutions that help to avoid unwanted dependencies in Java projects or at least discover them early:
- Put every module in its own JAR file. An ANT build script can then discover unwanted depdencies during compilation and generation of the JAR files.
- If Eclipse is used: Define an Eclipse project for every module and let Eclipse manage the dependencies.
- The use of the Eclipse plugin model allows even finer control but brings some overhead with it.
- Define the allowed dependencies in a Fitnesse test. There is an easy to use solution named JDependFixture. Especially when you use Fitnesse already the your project JDependFixture may be a convenient solution.
- XRadar is also based on JDepend and checks dependencies between modules (in XRadar modules are called subsystems). XRadar uses a XML definition of modules and dependencies and creates a graphical representation of the existing dependencies. XRadar is especially convenient when a nightly build process is in place, for example based on Cruise-Control.
Post bewerten
Keine Kommentare:
Kommentar veröffentlichen