JRuby on Rails a first attempt
February 6th, 2008 at 2:53 pm by Arjen van SchieTwo months ago we started with the development of a prototype application for a client of us. The goal of the prototype was to gather requirements and discuss them with the customer, which were non-technical users.
The prototype had to be constructed within a small time frame, so we chose to implement it with the JRuby on Rails. First of all because we wanted to get experience with (J)Ruby
on Rails on a ‘real’ client assignment and second of all, because we had a lot of fun and good experiences in the test-drives we had with RoR.
We decided to use a more-or-less agile development strategy. We developed using NetBeans 6 on Windows (later on we switched to Linux) and we debugged with IE and Firefox. Especially Firefox with firebug is essential when using Ajax.
During the process we used the following plugins to speed things up.
- Visualize_models to generate a picture of the data model to check for errors.
- Ar_fixtures for serializing the database to fixtures (and back).
- Act_as_authenticated and role_requirement for authorization scaffolding.
- ActiveScaffold for scaffolding on the admin interfaces.
- Gruff for realizing simple charts
This all resulted in a very short development track with nice results.
But of course not everything was perfect. We encountered the following problems throughout the project:
- Refactoring Ruby is not supported in tools, at least not sufficient.
- Hard to see code dependencies between methods/classes.
- JRuby on rails is still kind of slow.
- Date / Datetime conversion is kind of problematic (as with most languages in my opinion)
- Use of instance variables and partials can be tricky and result in hard to find nil-errors
- Migrations are not transactional. Errors in migration will leave you somewhere in between migration X and X+1
Some of these points will be better when tool support increases, others might be unavoidable .
But to make a long story short, we did finish the prototype within a really short time and we accomplished way more work then we imagined up front, so we could call it a success. I would really recommend (J)Ruby on Rails for our prototype / requirements courses. Because getting the base of an application up and running (the first 80%) goes extremely smooth and fast.
For full applications, I think we should realize that the benefits of Rails can’t be linear extrapolated for the last 20% because this typically requires specific functionality that is not available in the frameworks; like business rules etc.
Popularity: 783 points

