ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yusuf" <Yu...@ekalife.co.id>
Subject RE: iBatis usage pattern
Date Mon, 23 Jan 2006 03:05:35 GMT
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?

-----Original Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent: Saturday, January 21, 2006 6:10 AM
To: user-java@ibatis.apache.org
Subject: Re: iBatis usage pattern

Hi Yusuf,
This is a big question!
Clinton is right that a JavaBean will be faster, but I've always thought
that the performance gain will be negligible and not noticed by any
user.  For me, this is not enough of an argument one way or the other.
I have been on both sides of the issue with Maps.  I like maps because I
don't have to create a POJO for every query.  But also like the more
robust datatype mapping that is available if you make a POJO.  And you
can use iBATIS "group by" functionality with a POJO and fill out a big
object graph if you need to. 
For me the bottom line is that you should create a good POJO based
domain model for your application, and then map as many of those classes
to iBATIS methods as possible.  If you need to add an occaisional Map
here and there for a wierd one-of-a-kind query, then I'd do it rather
than messing up the domain model. 
So the domain model is most imprtant to me.
My thoughts...
Jeff Butler

View raw message