ORM Expectations
November 10, 2005 @ 02:05 AMI’ve spent the last five years of my career working on a project where we built our own Object/Relational Mapping framework.
Pity me.
So you can imagine my glee upon getting Ruby on Rails’ ActiveRecord up and running… WOW. But the thing I find so amusing is all the chatter I hear about how ActiveRecord is really only good for new database schemas, and not currently existing ones. So I tried it out. I set up a Ruby on Rails webapp that utilized a fairly complex database schema. I had to add a line of code to most of my model classes (the schema uses singular table names instead of plural), as well as add a couple other optional attributes to my associations… so I ended up with. So I ended up with an extra 5 or 6 lines of code.
Maybe I’m missing something, but that’s still fantastic. At this point, I’d happily recommend RoR for use with existing database schemas. In my case, it turned out to be a great way to compare two ORM methods against the same schema.