For those haven''t seen it yet, Patrick Peak has an interesting article at the Server Side (www.theserverside.com) discussing the differences between the Hibernate (www.hibernate.org) peristence framework and ActiveRecord. The article can be found here: http://www.theserverside.com/articles/article.tss?l=RailsHibernate . Patrick Peak is the author of _Hibernate Quickly_ (Manning), which I didn''t find particularly readable, but he definitely knows his stuff. Just thought you might like to know, Ken Kousen -- Kenneth A. Kousen, Ph.D. President Kousen IT, Inc. http://www.kousenit.com ken.kousen-PxcIC9p/5bhWk0Htik3J/w@public.gmane.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ken Kousen wrote:> For those haven''t seen it yet, Patrick Peak has an interesting article > at the Server Side (www.theserverside.com > <http://www.theserverside.com>) discussing the differences between the > Hibernate (www.hibernate.org <http://www.hibernate.org>) peristence > framework and ActiveRecord. The article can be found here: > http://www.theserverside.com/articles/article.tss?l=RailsHibernate . > Patrick Peak is the author of _Hibernate Quickly_ (Manning), which I > didn''t find particularly readable, but he definitely knows his stuff. > > Just thought you might like to know,Interesting. One bit I''m not sure of:> # Like find all, but need complete SQL > @minersWithSqA = Miner.find_by_sql [ > "SELECT m.*, g.square_area FROM gold_claims g, miners m " + > " WHERE g.square_area = ? and m.gold_claim_id = g.id", 1000] > > The big thing to realize is that since Rails classes have dynamic fields, all columns returned by the result set are smashed on the Miner object. In the last query, the Miner gets a square_area field that it doesn''t normally get. This means the view might have to change, like so... > > # Normal association traversing > <%= miner.gold_claim.square_area > > # Altered query for @minersWithSqA > <%= miner.square_area %>Is this ever true? Doing that query doesn''t stop me from calling miner.gold_claim.square_area. He also makes the claim that Rails can''t not do lazy loading, which seems to ignore the :include option to AR::Base#find. Then again, it does have a publication date of over a year ago, so I guess it may have been true then. It would be *really* nice to know which versions he was comparing. -- Alex
I''d bet anything the version of RoR in the article was 1.0. Ken -- Kenneth A. Kousen, Ph.D. President Kousen IT, Inc. http://www.kousenit.com ken.kousen-PxcIC9p/5bhWk0Htik3J/w@public.gmane.org -------- Original Message -------- Subject: Re: [Rails] Interesting ActiveRecord vs Hibernate article From: Alex Young Date: Thu, May 04, 2006 9:24 am To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Ken Kousen wrote: > For those haven''t seen it yet, Patrick Peak has an interesting article > at the Server Side (www.theserverside.com > ) discussing the differences between the > Hibernate (www.hibernate.org ) peristence > framework and ActiveRecord. The article can be found here: > http://www.theserverside.com/articles/article.tss?l=RailsHibernate . > Patrick Peak is the author of _Hibernate Quickly_ (Manning), which I > didn''t find particularly readable, but he definitely knows his stuff. > > Just thought you might like to know, Interesting. One bit I''m not sure of: > # Like find all, but need complete SQL > @minersWithSqA = Miner.find_by_sql [ > "SELECT m.*, g.square_area FROM gold_claims g, miners m " + > " WHERE g.square_area = ? and m.gold_claim_id = g.id", 1000] > > The big thing to realize is that since Rails classes have dynamic fields, all columns returned by the result set are smashed on the Miner object. In the last query, the Miner gets a square_area field that it doesn''t normally get. This means the view might have to change, like so... > > # Normal association traversing > <%miner.gold_claim.square_area > > # Altered query for @minersWithSqA > <%= miner.square_area %> Is this ever true? Doing that query doesn''t stop me from calling miner.gold_claim.square_area. He also makes the claim that Rails can''t not do lazy loading, which seems to ignore the :include option to AR::Base#find. Then again, it does have a publication date of over a year ago, so I guess it may have been true then. It would be *really* nice to know which versions he was comparing. -- Alex _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ken Kousen wrote:> I''d bet anything the version of RoR in the article was 1.0.It can''t be. If the article date''s accurate (March ''05), 1.0 was a good 7 months away (at least... don''t have dates handy). 0.8''s more likely. -- Alex
Andrew H. Johnson
2006-May-04 15:06 UTC
[Rails] Interesting ActiveRecord vs Hibernate article
Am I missing something?? Did something change in RoR 1.0 to ActiveRecord that this article was not correctly reporting? aj Alex Young wrote:> Ken Kousen wrote: >> I''d bet anything the version of RoR in the article was 1.0. > It can''t be. If the article date''s accurate (March ''05), 1.0 was a > good 7 months away (at least... don''t have dates handy). 0.8''s more > likely. >
Ah, I missed that. I thought it was current. I wonder why they waited so long to put it on The Server Side? Ken -- Kenneth A. Kousen, Ph.D. President Kousen IT, Inc. http://www.kousenit.com ken.kousen-PxcIC9p/5bhWk0Htik3J/w@public.gmane.org -------- Original Message -------- Subject: Re: [Rails] Interesting ActiveRecord vs Hibernate article From: Alex Young Date: Thu, May 04, 2006 11:03 am To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Ken Kousen wrote: > I''d bet anything the version of RoR in the article was 1.0. It can''t be. If the article date''s accurate (March ''05), 1.0 was a good 7 months away (at least... don''t have dates handy). 0.8''s more likely. -- Alex _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Andrew H. Johnson wrote:> Am I missing something?? Did something change in RoR 1.0 to > ActiveRecord that this article was not correctly reporting?At some point the :include option was added to ActiveRecord::Base#find, which enables eager loading. I thought it was before 1.0, but I could be wrong. The author makes much of the need to do piggy-back queries, which is exactly what :include does away with. -- Alex
On May 4, 2006, at 11:42 AM, Alex Young wrote:> Andrew H. Johnson wrote: >> Am I missing something?? Did something change in RoR 1.0 to >> ActiveRecord that this article was not correctly reporting? > At some point the :include option was added to > ActiveRecord::Base#find, which enables eager loading. I thought it > was before 1.0, but I could be wrong. The author makes much of the > need to do piggy-back queries, which is exactly what :include does > away with.The :include option has been part of Rails since at least 0.13 (not sure what the AR version would be), which was out last Summer. That''s when I first started using it... -Brian
Brian Hughes wrote:> On May 4, 2006, at 11:42 AM, Alex Young wrote: > >> Andrew H. Johnson wrote: >> >>> Am I missing something?? Did something change in RoR 1.0 to >>> ActiveRecord that this article was not correctly reporting? >> >> At some point the :include option was added to >> ActiveRecord::Base#find, which enables eager loading. I thought it >> was before 1.0, but I could be wrong. The author makes much of the >> need to do piggy-back queries, which is exactly what :include does >> away with. > > > The :include option has been part of Rails since at least 0.13 (not > sure what the AR version would be), which was out last Summer. That''s > when I first started using it...So it''s quite possible that it didn''t exist when the article was written. Is the article being presented as ''new'' anywhere? If so, it might be worth getting the author to make an update... Mind you, that''s the only point which he''s actually out of date on, so maybe it''s not worth it. -- Alex
Ken Kousen wrote:> Ah, I missed that. I thought it was current. I wonder why they waited > so long to put it on The Server Side?I remember seeing it there a year or so ago and printing it. What gave you the impression it had only just appeared? regards Justin
I received an email from The Server Side announcing new articles. It was listed in the email. I''m now mildly annoyed at them. I guess they must be re-running an old article, but I wish the email had said so. Ken -- Kenneth A. Kousen, Ph.D. President Kousen IT, Inc. http://www.kousenit.com ken.kousen@kousenit.com -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Justin Forder Sent: Friday, May 05, 2006 4:19 AM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Interesting ActiveRecord vs Hibernate article Ken Kousen wrote:> Ah, I missed that. I thought it was current. I wonder why they waited > so long to put it on The Server Side?I remember seeing it there a year or so ago and printing it. What gave you the impression it had only just appeared? regards Justin _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Ken Kousen wrote:> I received an email from The Server Side announcing new articles. It was > listed in the email. > > I''m now mildly annoyed at them. I guess they must be re-running an old > article, but I wish the email had said so.They would be very stupid to re-run such an old article - you have a right to be annoyed. I found my old hardcopy - it is dated 31st March 2005. regards Justin> -- > Kenneth A. Kousen, Ph.D. > President > Kousen IT, Inc. > http://www.kousenit.com > ken.kousen@kousenit.com > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Justin Forder > Sent: Friday, May 05, 2006 4:19 AM > To: rails@lists.rubyonrails.org > Subject: Re: [Rails] Interesting ActiveRecord vs Hibernate article > > Ken Kousen wrote: >> Ah, I missed that. I thought it was current. I wonder why they waited >> so long to put it on The Server Side? > > I remember seeing it there a year or so ago and printing it. What gave > you the impression it had only just appeared? > > regards > > Justin > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >