Hibernate on Ruby

L

listrecv

ActiveRecord is great for small-to-medium things, but does quickly show
it's limits on large things. NOTE: Please, do not turn this thread
into a flame war. See Martin Fowler's discussion of ActiveRecord
versus DataMapper. Rails's ActiveRecord is based on Fowler's
ActiveRecord pattern, wheras Hibernate is a DataMapper, which Fowler
himself favors for complicated mappings.

See DHH's post:
"No, you don't get the full offer of opportunities that straight OO
with a data mapper holds. I'd like to think, though, that Active Record
gives you 80% of the features for 20% of the effort."
http://www.loudthinking.com/arc/000209.html

Example for me:
Let's say I have a class hierarchy, in which a particular field is
stored direclty in the db for one class, and calculated using a simple
SQL formula for other other classes. How can I use the DB to query the
tree for all objects where field == aVal.

Answer: In ActiveRecord - you can't (w/o major hacking). You need to
instantiate each one from the db, and then use Ruby to check each one.
 
E

Eero Saynatkari

List said:
ActiveRecord is great for small-to-medium things, but does quickly show
it's limits on large things. NOTE: Please, do not turn this thread
into a flame war. See Martin Fowler's discussion of ActiveRecord
versus DataMapper. Rails's ActiveRecord is based on Fowler's
ActiveRecord pattern, wheras Hibernate is a DataMapper, which Fowler
himself favors for complicated mappings.

See DHH's post:
"No, you don't get the full offer of opportunities that straight OO
with a data mapper holds. I'd like to think, though, that Active Record
gives you 80% of the features for 20% of the effort."
http://www.loudthinking.com/arc/000209.html

Example for me:
Let's say I have a class hierarchy, in which a particular field is
stored direclty in the db for one class, and calculated using a simple
SQL formula for other other classes. How can I use the DB to query the
tree for all objects where field == aVal.

Answer: In ActiveRecord - you can't (w/o major hacking). You need to
instantiate each one from the db, and then use Ruby to check each one.

Google up Og and Kansas and see if either suits you better.
Both take a modeling approach perpendicular to AR. There
are others also, I am sure.

Or, of course, you could restructure your data :)


E
 
Z

Zed A. Shaw

Google up Og and Kansas and see if either suits you better.
Both take a modeling approach perpendicular to AR. There
are others also, I am sure.

Or, of course, you could restructure your data :)

No, that'd actually involve admitting he is wrong. The day a
programmer actually admits he's wrong is the day Satan ice skates
around Times Square in July eating Tasti-Delight while wearing long
underwear.

For another great example of "fighting to always be right" refer to any
thread about plural table names (either side).

Zed A. Shaw
http://www.zedshaw.com/
 
N

Neil Stevens

Zed said:
No, that'd actually involve admitting he is wrong. The day a
programmer actually admits he's wrong is the day Satan ice skates
around Times Square in July eating Tasti-Delight while wearing long
underwear.

Yeah, that's the way, go off on a tangent and berate someone for asking
a simple question, without actually giving him a straight answer.

Now I remember why I unsubscribed from this group before...
 
G

gabriele renzi

(e-mail address removed) ha scritto:
Any ideas on using Hibernate OR/M from within Ruby?


probably the only chance is using jruby, but are you sure you can't do
what you want with Og ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,646
Latest member
xayaci5906

Latest Threads

Top