In my opinion, this topic is just fine-- it comes up every week :-) I personally dislike O/R mappers because in most cases, I completely agree that beans and db should be separated, but it's at the point of merger that things get overly complex at the expense of an additional layer that needs just as much configuring as writing your sql code for each use case.
For example, with O/R, you have an ArticleHeader that has ArticlePage(s). You are actually storing the page content in the DB for various reasons. If you are using OJB with the goal of getting the number of pages the article has, in most cases, you are ending up selecting 1000+% of what you REALLY need from the DB: ----------------------------------- OJB: SELECT ArticleHeader key Check cache SELECT ArticleHeader and SELECT ArticlePage keys Cache it Call getPages() on ArticleHeaderBean SELECT each ArticlePage where cached key = DB key while checking the cache before EACH SELECT to ArticlePage table for EACH Row Builds collection of ArticlePages (including all of that page content) Call getSize() Vs. SELECT COUNT(key) FROM ... ------------------------------------ I guess I really can't reason the practicality of it. On the other hand, the ibatis.com db layer is VERY cool because it allows you to look at your use cases and write a select statement that can be executed; much like the way struts has actions. I get the bonus of caching objects with O/R mappers, but site performance is much better by caching the resulting output (the view itself) in most cases. Someone please enlighten me as to why someone would want to use O/R mappers :-) Best Regards, Jacob Hookom | -----Original Message----- | From: Mark Chaimungkalanont [mailto:[EMAIL PROTECTED]] | Sent: Tuesday, February 04, 2003 10:24 PM | To: [EMAIL PROTECTED] | Subject: [OT] Which Object Relational mapping tool? | | Howdy all, | | This is not about struts really... But I figured it could be relevant for | some people. If you know a better forum for relatively unbiased opinion, | please tell me & I'll take it there! | | Just looking into O/R mappers and have looked at (Briefly): | | Hibernate 2.0 beta 2 | Castor 0.9.4.2 | OJB 0.9.8 | | Does anyone know which is better for what? Which is the most "robust" and | mature development? Have any recommendations of any other ones? Had some | success/problems? Hibernate SOUNDS impressive and looks quite professional | but I haven't used any of them... | | Again, sorry for spamming the struts mailing list and will take it | elsewhere if it bothers people. | | Cheers | | MC | | | --------------------------------------------------------------------- | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]