Port RJS to Java. Ugh. i dread this task. I really do. Recreating RJS templates in Java….Yuck. I dread this task because I made fun of the prospect of some Java programmer having to recreate RJS in Java a few weeks ago on this blog, but, I’ve created an application in Rails that must be ported to Java. Don’t ask why, just know that it must be ported to Java. This isn’t the first time, I’ve had to port something from Rails to Java.
So…..errr…..what does one do if your Rails “prototype” makes heavy use of some of the most advanced features of RJS templates and you have to migrate to Java? My first thought: ask the fine readership of this blog if they have found themselves in a similar situation, or, better yet, is anyone out there already doing this? C’mon, I can’t be the only one in this wide world who has been using RJS and wondered, “Why can’t I do this in my Java application?” ….The first step, Google “RJS in Java” - that search returned a few hits, but mostly links to Rails RJS pages and links to blogs bemoaning the fact that Java isn’t there yet.
The real lesson here is “Never prototype with a technology more capable than the target platform.” So, take this as a lesson, if you are using Rails as a prototyping language, don’t use RJS, you’ll end up wishing that your prototyping technology was your production technology. As I’ve said before, J2EE is a trusted, capable platform, and in some ways it is lightyears ahead of Ruby, but, as far as web applications go Rails does laps around Java. So, maybe porting RJS to Java might help level the playing field? Maybe? Who knows, all I know is that I’m not the only only who thinks that Java is not Web 2.0.
Read on for the options…
option 1 - dead on arrival.
….and, the whole time, I’ll no doubt be thinking, “you know, if I could just do this in Rails, it would’ve been done ages ago”. Porting derivative technologies is never very satisfying, you always end up playing catch up.
3. Use another framework, something like Google Web Toolkit.
So there you have it, I’m leaning toward Option #2 and am beginning to think that it needs to be open source for the good of Javaland. Anyone have any input / suggestions?