Project Jigsaw might be pushed back to Java 9

Gotcha. I can see where the problem lies now. Even with the most amazing It Just Works modularity system in place I can see it turning into a maintenance nightmare if you’ve got multiple versions of the same classes floating around in the same application though :S Believe it or not when I used to do this sort of stuff (and indeed, was the manager) I stipulated that if you had two versions of the same library causing a problem you made it work with one or the other or ditched it.

Cas :slight_smile:

The thing with JEE is that you don’t have choices; you can’t be minimal, you can’t cherry pick, you-just-cannot. As soon as you install the application server you’re already married to a cool 100 libraries that are delivered as part of the implementation of the specification, are transient dependencies of said libraries and to just get the server to do stuff. Then you have that which you would like to do in your application which might just require libraries not delivered by the application server - the fun and “jar hell” starts there.

In that respect Jigsaw can help a lot because you could for example define the server as a module (or a set of modules) and each application deployed through it as a module of its own. You could define the components of each application (different webapp wars, EJB modules, etc.) as their own separate jigsaw modules. Application servers are now forced to use complex classloader schemes to get isolation working, with nightmarish problems as a result when you do it wrong and many limitations in what you can actually do.

Not to mention the biggest load of dung in JEE land: reloading of resources upon redeployment. Even 12+ years later it is still not great unless you fork over cash for JRebel. Classloaders are not my friend.

I’d guess that the real trick here (I’m not paying that much attention) is classloader partitioning to allow side-by-sides.

Related - was the application partitioning stuff part of Jigsaw? (The one where you can effectively run multiple Java lightweight processes inside a single JVM OS process, each with their own heap, garbage collector, etc)?

Cas :slight_smile:

Err…I got ninja’d again…need to pay more attention. My previous post was a response to Cas.

The quote mechanism is quite useful :wink:

@Prince Caspian: I don’t remember ever reading about that in the context of Jigsaw.

I’ve done a few OSGi apps, quite simple, but multiple versions did sometimes creep in. The answer whether that’s a nightmare or not is … it depends. If one app depends on two versions of Spring, then Yes, You Are Royally Screwed. However, if two libraries have dependencies on two different versions of, I dunno, commons-lang, then it’s no sweat at all. Eclipse plugins are another example here, where you can have different plugins using different libraries without interfering with each other.

And beyond plugins and libraries with skewed versions, remember you can have multiple apps outright. I never bother with that feature (I just spin up Jetty on a new port) but it’s still handy for a lot of people.

Going beyond multiple apps and having entirely separate java environments in one JVM is called multitenancy. That was not one of jigsaw’s stated goals, but it’d certainly give it a boost. One of the best uses of multitenancy is in mobile apps, and Dalvik has some support for it (but it’s kind of crude). Sun actually wrote a multitenant VM a ways back and Oracle makes noises about merging it into openjdk, so we might see it in java version, I dunno, 15 or so?

I wish a module system had been there from day one, i see lots of ‘svn projects’ with the dependencies in the repository as binaries that inevitably get out dated or their dependency unused (but still in the classpath because no one wants to ‘break’ things).

It’s just pathetic in the age of apt-get and maven (and the advantage of being able to test the new versions of the libraries easily is not to be overlooked either).

Quite frankly i’m getting sick of the slow lumbering java api. I guess i’m going to start programming in Rust or something if a decent standard api & compiler & tools ever emerges for that.