You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by Philippe Laflamme <ph...@mail.mcgill.ca> on 2005/01/17 17:55:16 UTC

FW: Bean Factory is available?

Forwarding message from ibatis-user-java mailing list, as per Clinton's
suggestion.

Philippe

> 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?
> 
> Thanks,
> Philippe
> 
> > -----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
> > <ta...@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
> > >
> > 
>