Managing Module Dependencies in Large Systems
In larger projects it is nearly impossible to avoid degeneration of large scale structures without tool support. It is far too easy to import missing packages with one key-stroke in modern IDEs like Eclipse or IDEA.
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.
Entry filed under: Uncategorized. Tags: .