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:
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.
Rails | Og |
---|---|
Comprehensive documentation | Documentation 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 tables | Default 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.