Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OR mapping framework for RoR

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does RoR have OR framework built -in ?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. It's called ActiveRecord.

I've heard that it's possible to replace ActiveRecord with Og, which is another ORM framework for Ruby, born as part of the Nitro web framework.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
Yes. It's called ActiveRecord.

I've heard that it's possible to replace ActiveRecord with Og, which is another ORM framework for Ruby, born as part of the Nitro web framework.


When you say it is possible to replace ActiveRecord by Og, will the data access code change? In java if I move from Toplink to Hibernate I will have to change the code.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't done that myself so I might be talking crap, but the above link seems to suggest that you need to write new glue code to replace AR with Og rather than change your application code.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
I haven't done that myself so I might be talking crap, but the above link seems to suggest that you need to write new glue code to replace AR with Og rather than change your application code.

Or, of course, you could just change your application code to use Og's API rather than ActiveRecord.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. How does one chose between ActiveRecord and Og.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradip Bhat:
Thanks. How does one chose between ActiveRecord and Og.

You don't choose. You just start using ActiveRecord as it is the standard.

Seriously, the number of people using Og must be several magnitudes smaller than those using ActiveRecord so you better have a real good reason to choose Og. Community matters. It's slightly different if you're a seasoned Ruby hacker, prefer Og, and are willing to jump inside the framework yourself to figure out what you're doing wrong.

(Disclaimer: remember that I still haven't actually used Og myself so I'm talking about my perceptions here)
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lasse. Looks like the competition for frameworks has already started in the Ruby world.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic