Thursday, December 27, 2007

JRuby on Rails - Book review

So what do you put in a book on JRuby? After all, for the programmer JRuby is 'just' another Ruby implementation. The question must have come up when Ola Bini decided to write this book. The result is materialized in Practical JRuby on Rails Web 2.0 Projects - Bringing Ruby on Rails to the Java Platform. The title is well chosen and also answers the question: JRuby on Rails is a practical book; it guides you through the implementation of several Rails sites and along the way it shows you neat tricks that are only possible in JRuby.

The first half of the book is all about JRuby on Rails. If you already know Rails it is funny to consistently see jruby instead of ruby, but otherwise this is part is boring for the initiated. If you do not know Rails and like to learn from examples, this chapter is well worth your read.

Right after that is an interesting part for all us that want to mix Java and Ruby.

Later in the book, Ola goes through the trouble of explaining how to use JRuby with all the non interesting things in Java: session beans, message beans, JMX, XML processing and SOAP. I have been in Java business for 7 years and have been luckily able to avoid these for most of the time. The integration provided by Spring could have been a very nice replacement for these subjects.

A bit hidden between this stuff, the book again shows it practicality and goes through all the options of deploying JRuby on Rails applications.

The book ends with some convenient JRuby specific references.

I strongly recommend this book when you are a Java programmer (of any skill) that knows some Ruby and want to start working with (J)Ruby on Rails. If you know Rails well, but little Java and you want to start with JRuby on Rails, the book is probably too heavy and will teach you only a few useful things. Do not start on this book with zero Ruby knowledge. Though appendix A helps, for seriously learning Ruby, the old Pickaxe (dead tree version) is an excellent first read.

1 comment:

  1. Hey Erik,

    Thanks for the book review - I might actually check that one out. I also had a look at Scala and man, that sounds sweet... :)

    But one thing in your post caused me a little headache: you are a Spring fanboy! ;)

    Just as you consider yourself lucky to not have worked with Session Beans, Message Beans etc. I consider myself immensely lucky to have finally managed to completely drive Spring out of my current project!

    Spring has had it's time but now - finally - people realize that configuration by convention is the way to go. And yes, Spring now supports annotations and "kind-of" allows for CBC, but all non-standard things you still have to do in XML files.
    Developers finally start to understand that XML configuration is just regular code - only without strong typing, compile time type checking etc. And these developers switch to frameworks that focus on doing just one thing, but that thing they do well: simplify ioc in applications.

    Google Guice ftw! :)

    All the best for 2008,