Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 5068 invoked from network); 23 Jan 2006 05:33:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jan 2006 05:33:38 -0000 Received: (qmail 9606 invoked by uid 500); 23 Jan 2006 05:33:36 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 9591 invoked by uid 500); 23 Jan 2006 05:33:36 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 9580 invoked by uid 99); 23 Jan 2006 05:33:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2006 21:33:36 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.36] (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2006 21:33:34 -0800 Received: from fe-amer-06.sun.com ([192.18.108.180]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id k0N5XDuf016058 for ; Sun, 22 Jan 2006 22:33:13 -0700 (MST) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0ITJ00E014IOK500@mail-amer.sun.com> (original mail from Nathan.Maves@Sun.COM) for user-java@ibatis.apache.org; Sun, 22 Jan 2006 22:33:13 -0700 (MST) Received: from [192.168.5.100] ([24.8.39.65]) by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0ITJ001BL63DWQO1@mail-amer.sun.com> for user-java@ibatis.apache.org; Sun, 22 Jan 2006 22:33:13 -0700 (MST) Date: Sun, 22 Jan 2006 22:31:58 -0700 From: Nathan Maves Subject: Re: iBatis usage pattern In-reply-to: Sender: Nathan.Maves@Sun.COM To: user-java@ibatis.apache.org Message-id: MIME-version: 1.0 X-Mailer: Apple Mail (2.746.2) Content-type: multipart/alternative; boundary="Boundary_(ID_HD83Fth3JbpSfdMaolqSqQ)" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Boundary_(ID_HD83Fth3JbpSfdMaolqSqQ) Content-type: text/plain; format=flowed; delsp=yes; charset=US-ASCII Content-transfer-encoding: 7BIT I agree with Jeff, The whole point of ORM is that both can be developed independently. You might have one class that is represented by multiple tables or the opposite case where multiple class are store in one table. I would suggest, like Jeff, making sure that your domain model is implemented without thought of how the data is stored. Then work on the mapping. Nathan On Jan 22, 2006, at 9:57 PM, Jeff Butler wrote: > Well I don't think it's exactly the concept of ORM. ORM normally > says that database design isn't as important as object design. The > philosphy with ORM is that the object model rules all decisions, > and that the database model should be subservient to the object > model. I don't think this is realistic in many enterprise class > applications - DBA's usually have other perfectly valid concerns > that can override this simplistic view of database design. To them > the database is much more than just a place to store our objects - > and they are correct in that thinking. > > So I would make an object model that matches your problem space. > And realize that this may, or may not, map easily to a set of > database tables. If there is a close match, then maybe Hibertnate > is a decent option. But in my experience there is often a huge > mismatch between the object model model and the database model. > This is where iBATIS shines and leaves the others gasping for breath. > > Lastly, let me say that a good POJO based domain model is a far far > different thing than "a class for each table". What I meant was > that it is likely that many of the persistence methods for your > domain objects can likely be mapped fairly easily to DAO methods > implemented in iBATIS. > > HTH - > Jeff Butler > > > On 1/22/06, Yusuf wrote: > Hi Jeff, > So let me conclude your explanation: > It is better to create a good pojo based domain model (bottom line, a > class for each table?) rather than using maps for results (except for > those one-of-a-kind query), and always try to group results to POJOs, > using the "group by" and maybe other ibatis' functionalities, but > never > mess with the domain model. Is it correct? If I'm not wrong, this is > also the concept of all those ORM tools like hibernate, jdo, and > others? > > Thanks, > Yusuf. > --Boundary_(ID_HD83Fth3JbpSfdMaolqSqQ) Content-type: text/html; charset=ISO-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE I agree with Jeff,

The whole point of ORM is = that both can be developed independently.=A0 You might have one class= that is represented by multiple tables or the=A0opposite case where = multiple class are store in one table.

I would suggest, like Jeff,=A0 making su= re that your domain model is implemented without thought of how the d= ata is stored.=A0 Then work on the mapping.

Nathan
On Jan 22, 2006= , at 9:57 PM, Jeff Butler wrote:

Well I don't think it's exact= ly the concept of ORM.=A0 ORM normally says that database design isn'= t as important as object design.=A0 The philosphy with ORM is that th= e=A0object model rules all decisions, and that the database model sho= uld be subservient to the=A0object model.=A0 I don't think this is re= alistic in many enterprise class applications - DBA's usually have ot= her perfectly valid concerns that can override this simplistic view o= f database design.=A0 To them the database is much more than just a p= lace to store our objects - and they are correct in that thinking.
=A0
So I would make an object model that matches= your problem space.=A0 And realize that this may, or may not, map ea= sily to a set of database tables.=A0 If there is a close match, then = maybe Hibertnate is a decent option.=A0 But in my experience there is= often a huge mismatch between the object model model and the databas= e model.=A0 This is where iBATIS shines and leaves the others gasping= for breath.
=A0
Lastly, let me say that a goo= d POJO based domain model is=A0a far far different thing than "a clas= s for each table".=A0 What I meant was that it is likely that many of= the persistence methods for your domain objects can likely be mapped= fairly easily to DAO methods implemented in iBATIS.
= =A0
HTH -
Jeff Butler

=A0
On 1/22/06, Yu= suf <Yusuf@ekalife.co.i= d> wrote:
Hi Jeff,
So let me conclude your explanation:
It is better = to create a good pojo based domain model (bottom line, a
class fo= r each table?) rather than using maps for results (except for
thos= e one-of-a-kind query), and always try to group results to POJOs,
= using the "group by" and maybe other ibatis' functionalities, but nev= er
mess with the domain model. Is it correct? If I'm not wrong, t= his is
also the concept of all those ORM tools like hibernate, jdo= , and others?

Thanks,
Yusuf.


--Boundary_(ID_HD83Fth3JbpSfdMaolqSqQ)--