ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe Laflamme" <philippe.lafla...@mail.mcgill.ca>
Subject RE: Bean Factory is available?
Date Mon, 17 Jan 2005 14:30:53 GMT
I'm not sure adding the functionality in the DAO would be very efficient.
Maybe I'm missing your point, but consider the queryForList() method, it
would require iterating on the results to create a proxy for each item in
the List... It would be much more efficient if the proxying mechanism (or
whatever) was applied upon bean creation.

Personally, I think that having an external bean instantiation mechanism
would make iBatis a much more flexible framework... For example, it could
help unit tests for statements (create test beans to test set and get
calls), all sorts of caching, initialisation or security processes could be
applied but most of all, statement result classes could be defined as
interfaces. To me, the last point is the most interesting...

Would anybody else find it useful to have interfaces instead of classes when
mapping statement results? What does the iBatis dev team think?


> -----Original Message-----
> From: Clinton Begin [mailto:clinton.begin@gmail.com] 
> Sent: January 15, 2005 11:23 AM
> To: ibatis-user-java@incubator.apache.org
> Subject: Re: Bean Factory is available?
> Hi Tak,
> No, that's not something we support.  But that sounds like 
> something that would be best done by your DAO class.  An 
> alternative would be to put a dynamic proxy behind the 
> SqlMapClient interface and proxy your classes on the way out 
> of the queryForXxxxxx methods.
> Cheers,
> Clinton
> On Fri, 14 Jan 2005 08:08:34 -0500, 
> takyoshida_consultant@cusa.canon.com
> <takyoshida_consultant@cusa.canon.com> wrote:
> >  
> > Hi,
> >  
> > Is there a way to set bean Factory to resultMap instead of setting 
> > bean class directly? I mean,
> > <resultMap id="result" class="my.model.Person"> 
> > to something like 
> > <resultMap id="result" class="my.PersonFactory"> 
> >  
> > so that I could create proxy on top of my class.
> >  
> > thanks,
> > Tak 
> >

View raw message