dagblog.
← Archive

Change the infrastructure, not the language


Listening to the latest Java Posse podcast made me break into a slight sweat. The guys were discussing changes to Java’s syntax and extensions to its semantics. Some of that syntactic sugar does appeal to me, but there are plenty of other areas Java 7 or 8 could address that developers would appreciate just as much. One is Java’s own infrastructure, the compiler and VM, which could be extended without doing much damage to backward compatibility. Here are my suggestions.

Dynamic class reloading

Anyone who’s built a web application will tell you constant redeploys are hell. A substantial class change means redeploying the application even if you use the JVM’s HotSwap feature. I doubt adding dynamic class reloading to the JVM would be a problem, particularly when there are already pioneers in the field. See JavaRebel Brings Class Reloading to Java.

Declarative visibility modifiers

The visibility modifiers (public, private, protected and the default) aren’t enough. It would be useful to say declaratively, through annotations or a descriptor, which classes or methods to export for public use. OSGi and its bundle descriptors have led the way. Let’s hope all those superpackages and JAMs have learned from them.

Isolation inside the JVM

The idea of isolation within the JVM comes from the Multitasking Virtual Machine. The point is that applications sharing a VM should interfere with each other as little as possible. See the hosting problem. It’s a typical issue for web applications running in the same JVM instance. It would be useful to control how much they can affect each other, ideally leaving no interference at all. That goes hand in hand with setting limits on resources such as CPU, memory and network I/O that an application can use.

The list could go on. Add whichever feature you’d most like to see in Java’s infrastructure. I’m afraid that instead of investing in better infrastructure, we’ll be fobbed off with a bit of syntactic sugar. It’s the cheaper way to make things look shiny.

Medium version

Related articles

Related CZ Podcast episodes