• Share this article:

Visualizing Java 9 Module Relationships

Tuesday, December 1, 2015 - 17:39 by Wayne Beaton

As I stated in an earlier post, I’ve been running Eclipse Neon on the Java 9 + Jigsaw builds for a little while and haven’t had any issues. I spent a few hours over the weekend tinkering with some modularity tool ideas. I wrote a little plug-in for Eclipse Neon that visualizes the connections between the various modules.

modules1

The implementation is a little rough right now as I was focused on just sorting out how to get the various bits of technology to work. The Modules Dependencies View updates whenever the user highlights a Java project (e.g. in the Package Explorer, Project Explorer, or Navigator): it queries the Java runtime associated with the project for its list of modules and readability associations between them, and then uses Eclipse GEF Zest to visualize the results.

The part where I query the Java runtime is a huge hack right now, but the good news is that in playing with the visualization, I may have sorted out a better less hacky way of getting this done. More on this later.

I’m also just relearning how to use Zest (not that I was ever much of an expert with it), so there’s probably more that I can do with the layout algorithm. One thing that I did do was make it so that you can drill down into any single module with a double-click.

modules2

While I was at it, I threw together a quick tree view that lets you drill down through the reads relationships between modules.

moduleTree

It’s all very ugly of course, but it’s been pretty helpful for me see all the parts. I need to test this with a custom jimage (perhaps I’ll build one based on one of the compact profiles).

It would also be cool to include full build path of the Java project (e.g. workspace contents and JAR files) in the visualization. I also completely disregarded layers and should probably put some thought into representing them.

I haven’t pushed out the code yet; it will appear in Eclipse Labs when it’s a little more fully-baked.

Note that JDK 9 is going to slip a bit: with less than two weeks to go before the “feature complete” deadline, a proposal has been put forward to extend the release date by six months.