From Java to Ruby Journal Part 1: Introduction and the Decision

Published: 21 Jan 2007

Introduction

This is the first post of many to come documenting my progress of porting an existing e-commerce web application from Java to Ruby on Rails.

Background on the Java Application

The Java application, after three years of nearly no changes to the code (other than routine maintenance and bug fixes) or the look and feel is in desperate need of some enhancements. After seeing Endless.com, the newest production from the folks at Amazon, I knew I wanted the opportunity to do something similar with my client's slightly outdated and unoriginal website.

The Decision

Coming from a mostly Java enterprise environment (now called JEE), I've always looked for ways to make my development in Java faster to the point where I haven't had to worry about tedious bean generation, worrying about closing ResultSets in JDBC code, or wiring together the domain, service and web layers. It always seems like it's days after I start a new Java web application that I actually start getting into the real business processes or original thoughts about how the application should work. Although home grown code generation scripts and awesome frameworks like Spring have made wiring together JEE applications bearable and more pleasurable, Java is still a dog when it comes to rapid prototyping and getting stuff done faster.

As a full-time hacker(legal and lesser known definition) I'm always on the prowl for frameworks, languages and tools that make my life easier and let me spend my time more efficiently. While working for a Fortune 100 company a while back a co-worker of mine mentioned a language I had also started hearing about in the development circles. He would shout over the cube wall praising it's simplicity and how easy it was to put together a small code generator with the new language.

Enter Ruby on Rails

Since initially hearing about Ruby and Ruby on Rails, I've been keeping close tabs on the progress of the language and the acceptance by people I admire including Martin Fowler. I have been saying for at least a year now that I would "learn Ruby" and add it to my developer toolbox for a possible project sometime in the future. I'm not sure about you but whenever I hear myself saying "I'm gonna look into that some day" or "I'm gonna learn that...", a little voice of doubt calls out. So I've come to the point where I feel like I may have missed the wave of becoming a proficient Ruby coder when it matters most (when they are in short demand). Long story short I decided that to truly "learn" a language you have to put it into practice and hopefully not get crushed by the coral reefs after you've fallen off the "wave of n00b angst".

As a sanity check for committing to the decision of porting the tired Java application, I made a small list of general must have requirements in terms of the existing functions that must stay and the planned enhancements. The only hiccup that I found that may give me trouble is integrating the site's shopping cart with Verisign for payment processing. From what I've read there's no direct support but I also saw a small book put out by the Pragmatic Programmers that is entirely about this issue. So going on faith that I will be able to implement a workaround or the book will provide enough valuable insight, I decided to move forward. The next step I decided was to read as much as I could using a couple of highly recommended books and get started.

In my next post I will evaluate some of the tools and development best practices (not from personal experience but from what I read) when working with Ruby.

Until then I'd love to hear about similar experiences with making the leap from Java to Ruby specifically in the context of web applications. I'd also be interested in hearing about recommended books, IDE's, and other resources.