Saturday, April 22, 2017

Java 9 Module System (Jigsaw) @ LJC's HackTheTower



Today we spent half a day, on our first HackTheTower event. Members of London's Java User Group (aka LJC),  gathered on the 26th floor of  'SalesForceTower'  (aka Heron Tower) at the City of London, invited by
to talk and learn about one Project Jigsaw, Java 9's modular-isation system. The event was well organized, and coding from above, viewing London's town center and the rest of the skyscrapers is really a thing!

The event was splint into 3 sections, where we were given exercises and material to cover around Jigsaw (small examples, similar to the one you will find on OpenJDK's pages) and then we could talk about or raise any concerns or missing things that we felt the should be fed back to the OpenJDK / Oracle devs, evolving Jigsaw.

You can find all the material / slides & our feedback on the following links:

 How do I feel about Jigsaw

I have to be honest, it seems that Jigsaw is my least favorite feature of Java 9. It was one of the reasons I joined the event. Not because it is a bad feature as such or the actual needs behind it, especially the one to make the core of the JDK/JRE modular or more IoT friendly. But because of the potential side effects on the existing Java ecosystem and applications. It is really the first time that I eventually I did not trial personal or work related projects with pre-releases, to see if they work with the new version of Java, because of the various problems (and I still have).

Were we missing Jigsaw like functionality? Yes. Did we have similar attempts? Yes we had, OSGi (was covering many parts), then years after JBoss Modules. I always found OSGi a nice idea, but too complicated . I had the chance to work with JBoss Modules, I liked it but this was only on a product that was built on top of it, the Wildfly Application server, so it was like a full-filled prophecy, so I never tried to applied on my project or any of the projects I worked for.

Today I was kind of frustrated seeing examples of Java code, accompanied with  bash scripts calling jdk specific command like tools. Javac with flags, jlink or jmod, Jars that are not jars, but they behave like jars. I felt like my first Java day's at the uni, where eventually Ant was still NOT a thing, and java was compiled with bespoke make file mechanisms etc. Do I like all this new tooling? No. Why? Because as an application/ business developer I rely on abstracted build tools and I expect they do the heavy lifting for me, i dont want to go back editing module- descriptors or fighting existing build tools where the Plain Old Jar is the king, with the new king the Module and vice versa.

So, currently I don't see a clear path for existing, mainstream Java Built tools. Yes work is underway, for example the Maven Compiler Plugin version 3.6.1 is Jigsaw compatible. By the way it seems that currently you need to map and package your JigSaw modules as Maven Modules, so that you can have the best of 2 world. I don't know this whole thing confuses me a bit, unless I miss something.

It seems that we are heading towards a Java ecosystem, at least for Java 9, where either you play with Jigsaw's rules and you start building something new from scratch, introducing modules & project structure compatible with Jigsaw semantics or you kind of close your eyes,  add the 'kill switch' or your java executions  and continue your quest towards the new and the old world.

Last but not least, I can not ignore, the increasing number of worries and posts from application server, library developers on the potential problems Java9 might introduce to their libraries. I guess all java application developers would like to use Java 9, but if it is like going to introduce 1000 new issues because Spring Class-loading is not working any more, or CDI or any sub-module of their application server is going to break this is kind of unnecessary noise. 

So for the time being I am skeptic about it, but I will continue to invest time and learn more or experiment with it, most probably not using my SpringBoot or WildflySwarm projects but rather simple. 

I really liked the following articles
  • https://blog.plan99.net/is-jigsaw-good-or-is-it-wack-ec634d36dd6f 
  • https://developer.jboss.org/blogs/scott.stark

No comments:

Post a Comment