Groovying it up
So the latest project I’m working on requires integration with a legacy Java app. It’s a replacement for a struts application which I’ve mentioned briefly before, and refactoring the struts app was more pain than it was worth. (The struts app connects to another enterprise Java application.)
My experience with enterprise-level Java is, to say the least, almost totally non-existent. I studied Java (along with Ada and C amongst others) back at uni, but that was about the extent of it. I came into the business world using RoR, and I can’t say it’s been a bad thing.
As far as integrating the existing software using RoR; well, let’s just say that neither JRuby nor RJB was fulfilling the requirements. They’re both great projects, but it just wasn’t working for me.
Enter Grails. A breath of fresh air in the stifling world of Java.
So far it has lived up to expectations; I’ve stayed clear of importing the entire struts application into the src folder at this point. Rather, I have re-used the necessary Java code (usually translated into the more succinct Groovy version) where necessary.
I’d have to recommend Grails as the framework of choice if you’re coming from RoR and require strong Java integration (if you’re building a clean app, that is). It’s not quite as developed as Rails (it’s only at version 1.1.1) but it’s showing plenty of promise and provides the same quick prototyping facilities, which means you can get on with writing useful code.
One tip: I spent a week trying to establish a connection to a remote Oracle database using jdbc:oracle:thin; without success. For those of you coming from the Ruby world (where what little configuration there is is almost embarassingly easy), use jdbc:oracle:oci8 if you can. Worked first time. Unfortunately, all the tutorials/help pages etc used thin, and it was only by accident that I came across a mention of the oci connector. Rookie mistake in the Java world.