James Carr | Rants and Musings of an Agile Developer

Nov/07

15

JRuby, Groovy, and Other Dynamic Languages On the JVM

Lately (thanks to Spring) I’ve been toying with dynamic languages a little bit running on top of java. I haven’t delved into JRuby on Rails yet, but I have been using them as scripted beans injected into java classes, largely in a way that exposes an application API to either a scripted environment, or to take advantage of their dynamic features. I have always loved Groovy, Ruby, and Javascript for two things: closures and the ability to add methods to a class at runtime. Something strikes me as great being able to to code something like:

tomorrow = 1.day.from.now;

Being able to write code that is so expressive like that is somewhat satisfactory, and I like being able to quickly prototype ideas with out the painful build process JEE development always entails. Let’s face it… JEE development is sometimes overly complex. Maybe we overcomplicate things by making or programs too abstract. Maybe we just need better “killer frameworks” to minimize the “plumbing work” (this is why I like Spring). Although the Ruby zealots will brag about what a breeze development is, imho they miss the point that the reason it’s such a breeze is because Ruby on Rails takes away all the boring work. Recently I almost felt like JEE is getting close while doing a Stuts 2 + Spring 2 + JPA + AJAX tutorial. Maybe we need Spring on Rails.

I don’t know… maybe I’m rambling, maybe Dave Thomas, Bob Martin and all are right saying “Java is the new COBOL.” Maybe JEE just needs to adapt to keep up with high paced development.

One thing is for sure… each time I use scripted beans with JRuby and Groovy to quickly prototype ideas I can’t help but think to myself, “Why not just write applications like that?” ;)

No tags

3 comments

  • Andres Almiray · November 15, 2007 at 2:01 pm

    Oh but we do have a “Spring on Rails” sort of thing, its called Grails (http://grails.org). Grails leverages Spring (+SpringMVC)/Hibernate/SiteMesh/Quartz among others to bring back the fun into webapp development and increase your productivity.

    Reply

  • Admin comment by James Carr · November 15, 2007 at 3:01 pm

    Yep.. Grails has been on my list of things to try out… maybe now I have a really good reason to! ;)

    Reply

  • Peter Lawrey · November 15, 2007 at 5:52 pm

    You should give BeanShell a try. This allows you to run Java dynamically and supports closures.
    While this behaviour is cool, I have yet to find a compelling reason to use it at work, except for perhaps unit tests. We have used Jameleon which is a scripting language which suited to unit tests.
    If you find something which makes unit tests fun, let me know! ;)

    Reply

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me