Rails for Java Developers
I’m browsing through Stuart Halloway and Justin Gehtland’s recent book “Rails for Java Developers” , published by the Pragmatic Programmers. The mere fact that there are more and more Java centric Ruby and RoR books out there tells you something. And while my main language is C#, there are enough similarities with Java to make it interesting to read. “Rails for Java Developers” has the single best discussion of ActiveRecord I have ever seen. I especially appreciate how the authors pulled ActiveRecord out on its own and discuss it without being tied directly to RoR. The book juxtaposes ActiveRecord against Hibernate and touches on many of the points most important to people working with ORM frameworks. ( I work with one in .NET as well so this was very applicable ). For example, the definition of a POJO and its XML Mapping files in Java took up an entire page in this book… turn the page and come face to face with the following line:
The ActiveRecord approach requires exactly one line of Ruby code and no YAML or XML. Simply create the class with the right name: class Person <ActiveRecord::Base; end
Did you see that? 1 line of code !
Ok, I am a big skeptic when it comes to frameworks and tools. They all work nicely when you have an ideal environment, but what if you have to manipulate them under the hood. What if you are working with the legacy schema from hell? Well, there are examples that show what to do and how to override functionality to make ActiveRecord do your bidding.
I’m not a Java developer, yet I found this book well worth my time. Hope you will too.
Comments
Comment from Dan
Date: 2/22/2007, 4:50 am
“Did you see that? 1 line of code!”
Going back to the analogy discussed here the other day regarding the computer engineering profession as compared to doctors and lawyers: could you imagine a doctor bragging to his patient “I can remove that appendix with 1 yank!”, or a lawyer bragging to her client “I can beat that murder rap with 1 sentence!”…?
Your skepticism about these quick-start frameworks is well-founded. Frameworks are now all about gimmicks and buzzwords. You might say we’re in the “tail-fin era” of the software engineering profession, where the noise generated by features like schema-o-matic obscures any real discussion about proper engineering.
Comment from Thomas
Date: 2/22/2007, 6:13 am
Nothing like holding my blog comments against me ![]()
I admit that in order to buy into that one line of code you also have to buy into a lot of other baggage that comes with with use of a prebuilt framework. I was amazed by the difference between Hibernate an ActiveRecord. Of course you write your own tools. You need to elaborate on Tools an Hacks what proper engineering is.
Write a comment