Say hello to .jam

Image1Some time ago, I called Java Modules (JSR 277), the most important feature in Dolphin (Java 7), but I didn’t attend Stanley Ho’s BOF presentation at JavaOne in May. I’m going thru the slides now which explain the different scope it has compared to JSR 294 (the recently submitted “Improved Modularity Support in the Java Programming Language”, aka “super-packages”). JSR 294 is development-time and language driven while JSR 277 is all about deploy-time.

Did you know that one of JSR 294’s goal is to enable “separate compilation”, i.e. compile against an interface without needing the actual implementation?

Most of JSR 277 has to do with annotating JSR 294 modules. Pretty much like moving archive manifest information to Java annotations. Here’s an example from the presentation:

@Exports({ "icons/graphics1.jpg", "icons/graphics2.jpg", "META-INF/\*\*"}) @ModuleAttributes({ @ModuleAttribute("my.greeting", "Hello World!"), @ModuleAttribute("java.magic.number", "CAFEBABE")}) @MainClass("com.sun.myModule.myStuff.MainApp") super package com.sun.myModule { export com.sun.myModule.myStuff.\*; export com.sun.myModule.yourStuff.Interface; import org.someOpenSource.someCoolStuff; com.sun.myModule.myStuff; com.sun.myModule.yourStuff; com.sun.SomeOtherModule.theirStuff; }

The versioning scheme is similar to that used by Java, it leverages some of JNPL’s notations, and adds the notion of family and union of ranges. In terms of packaging, say hello to .jam files which will be stored in one of three levels of a repositorie: bootstrap (core JVM), shared or user. Can’t wait to get my hands on the first Dolphin builds and see what’s there. Mustang is soooo 2006.


Author: alexismp

Google Developer Relations in Paris.

3 thoughts on “Say hello to .jam”

  1. I just realised where Java is going. This code is not intended to be edited by humans, but by code generators. That makes me just a little bit sad.

  2. I’m not sure what I mean, it’s just an instinct from looking at the code. I have done plenty of J2EE development, trust me, I started the hard way with too many xml files open in text editors, several command promtps and trying to remember which command I had to run next and which xml file to edit in which order.

    I suppose I meant the above code is yet more framework and less implementation, which to me makes it look like the above code is intended to be generated meaning we only need to program the business logic – if you can even call it programming :-)

    It’s not neccessarily a bad thing, but as Churchill would say “it is not the end – it is not even the beginning of the end, but it is, perhaps, the end of the beginning”.

Comments are closed.