ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandre Grenier" <Alexandre.Gren...@markettools.com>
Subject RE: Creating a DataTable from an IList returned from the data mapper
Date Wed, 19 Jul 2006 20:36:36 GMT
To me, adding this code makes a lot more sense than building the
functionality directly into IBatis. IList<> is the de facto container
for object collections, mapping to objects seemingly being the main
function of ibatis (e.g. constructor mapping), so we can see here that
the line is drawn at the very first boundary - collections and
compositions.

 

To add the datatable mapping requires only a small piece of code. I
realize it is obscure and adds coupling to deeper parts of IBatis.
Consequently, someone evaluating IBatis with datatables or reporting in
mind will most likely turn away as they will not realize this
possibility. So there is a gap to bridge.

 

I think a good (but involved) solution would be to have an adapter
library or adapter libraries for IBatis that would wrap the code to map
to datatables, datasets, XML, etc. thus making IBatis a very attractive
solution for reporting. Each adapter would then be able to expose its
own mechanism appropriate for what it is mapping to. It would also
clarify the code in the event that mapping to objects and lists and
datatables and what not are all required in the same system.

 

The other way around, including datasets in the main lib, creates a
wrong precedent for extending ibatis. Other types of mappings will most
likely follow this precedent until ibatis can map to so many things it
will seem like a general purpose library. My impression is 100%
reversed, that if ibatis is extended, it should be to emit domain
entities from alternative data sources other than a database. It
actually already leans forward in that direction with providers.

 

Just my $0.02 (ok, maybe a buck fifty) :-)

 

Alex

 

________________________________

From: Gilles Bayon [mailto:ibatis.net@gmail.com] 
Sent: Wednesday, July 19, 2006 3:28 PM
To: user-cs@ibatis.apache.org
Subject: Re: Creating a DataTable from an IList returned from the data
mapper

 

You could do something similar for DataTable

 

DataTable dataTable = new DataTable(); 
...
Mapper.LocalSession.CreateDataAdapter(scope.IDbCommand).Fill(dataTable);


Mime
View raw message