Dienstag, Jänner 10, 2006

Active Record vs. Og

Currently, I'm experimenting with the two most popular Ruby ORM APIs, namely Active Record and Og (by the way, convincing Og to work properly was quite time-consuming due its outdated documentation...). However, the philosophy of these two libraries are quite contrary. The most important differences I have spotted so far are:






RailsOg
Comprehensive documentationDocumentation is partially outdated
Database Driven (no need to define properties, all metadata is fetched from the database)Object driven
Common base class for all persistent classes (ActiveRecord::Base)No common base class needed
Default naming convention is "Name" (singular) for classes and "names" (plural) for database tablesDefault naming convention is "Name" for classes and "ogname" for database tables

What I like most about Og is, that it doesn't force you to inherit from a common base class. Actually, this was the most important reason for me to try out Og at all.

Active Record tries hard to help you produce readable code (and table names ;)). Personally, I like Active Record's pluralization approach very much. It looks like that after a few hours, Active Record's API appeals more to me than Og's. However, my opinion could change after gaining more experience with both libraries.

2 Comments:

Anonymous Anonym said...

I officially anounce you my new Ruby Dealer. All the more if you keep using Ubuntu!

Please let me know what you think about the miniagg!

josef

aaahhh.... btw, is it just me or do these blogger captchas really really suck?

7:31 AM  
Anonymous Anonym said...

Og is considerably more powerfull than AR. You can use advanced OOP constructs like polymorphism and extension, and can uise non SQL stores. For more examples have a look at the Nitro Framework examples package. Also have a look at the videos: www.nitrohq.com/view/Videos

11:12 AM  

Kommentar veröffentlichen

<< Home