Saturday, November 20, 2010

Patching Java App on Deployment Site?

Application using Java (or any compiled programming language, like Scala, C++) is more cumbersome when you want to patch a running application on a deployment site.

Meaning, while Java development is pretty good when you have an IDE and the development environment setup properly... it starts becoming a nightmare when you want to debug/edit/diagnose your application on a deployment site that has none of those goodies.

Compared to an interpreted programming language, like PHP, Python, Groovy, ... you can change a single line of file and have your changes readily available. Sometimes without restarting the application...

Intermezzo: I say "sometimes" because a moderately complex application will have caches and other infrastructure that can make simple "refresh-driven patching" model impractical. One can say that "caching" is similar to an On-Demand Compiler. The difference is that cache generator is bundled with the application, while Java class/JAR files can only be generated by javac compiler plus the appropriate build system.

(Partial) Alternative #1: Remote Debugging aka JPDA (Java Platform Debugger Architecture)

With this, it's possible to connect to a running application, even remotely, and debug whatever it's doing, still using your trusty IDE on your development laptop.

However, deploying the modified application is still a problem. You can compile and build your application in your laptop, but deploying it to the remote site is a different issue.

(Partial) Alternative #2: Use A (Java EE) Application Server

Whether you use Tomcat, GlassFish, JBoss AS, Jetty, or any other application server... Deploying the application from your development workstation should be trivial.

You need to have the full application sources first, and able to build it. But after you can build it you can deploy relatively easily.

Of course, this still doesn't solve the problem that you can't work without a workstation with proper development setup.
And you can't just "change a file" in the deployed host.

You still need a development setup!

Any suggestions?