You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Larry Meadors <la...@gmail.com> on 2005/05/18 19:24:56 UTC

QueryForDataSet?

I am trying to use iBATIS.NET <http://iBATIS.NET> for my first real .net 
application...and as a .net noobie, please cut me some slack.

:-D

We have a consultant on site, and he is asking if we can get a DataSet out 
of iBATIS...looking at the code, I do not see that in our version (1.0.1.321), 
but I am curious if that is something that is in the near future, or not?

I am not terribly fond of the idea, for all the same reasons that I do not 
use Maps in iBATIS for Java, but at the same time, want to be able to use 
this to avoid the string concatination / parameter binding crap I currently 
have in my code.

Any thoughts or suggestions?

Larry

Re: QueryForDataSet?

Posted by Ted Husted <te...@gmail.com>.
>  Any thoughts or suggestions?

Oh, and, if you're test-driven, like me, you might want to hook up
with NUnitASP

* http://nunitasp.sourceforge.net/

and 

* http://www.testdriven.net/Default.aspx?tabid=1

(This plugin really, really rocks!)

I spent yesterday updating nearly every query in our application to
add new functionality, happily running and updating my tests along the
way. No FUD here :)

-Ted.

Re: QueryForDataSet?

Posted by Ted Husted <te...@gmail.com>.
On 5/18/05, Larry Meadors <la...@gmail.com> wrote:
> I am trying to use iBATIS.NET for my first real .net application...and as a
> .net noobie, please cut me some slack.
>  
>   :-D
>  
>  We have a consultant on site, and he is asking if we can get a DataSet out
> of iBATIS...looking at the code, I do not see that in our version
> (1.0.1.321), but I am curious if that is something that is in the near
> future, or not?
>  
>  I am not terribly fond of the idea, for all the same reasons that I do not
> use Maps in iBATIS for Java, but at the same time, want to be able to use
> this to avoid the string concatination / parameter binding crap I currently
> have in my code.
>  
>  Any thoughts or suggestions?

First, get started on the right foot and check out Spring.NET :)

* http://www.springframework.net/

And, if you are doing a web application, snag the CVS version, to get
the Spring.Web support

* http://opensource.atlassian.com/confluence/spring/display/NET/Spring.Web

As mentioned, iBATIS.NET expects that you will use your own objects
rather than DataSets. But, if you are using Spring.Web, you can get a
very slick domain object layer going, since Spring.Web can roundtrip
between your objects and the .NET controls.

I'm using Spring.NET extensively now, though I'm still going my own
way in some places.

-Ted.

Re: QueryForDataSet?

Posted by Ron Grabowski <ro...@yahoo.com>.
I wonder why they didn't mimic BaseDataList's (what Repeater, DataGrid,
and DataList extend) idea of a DataSource property that accepts an
object. That would allow the user to pass in an IList of entity
objects.

If DataTables are to be supported, here are some cases they should
handle:

 Ability to pass in strongly typed DataTable to be populated
 Ability to return new strongly typed DataTable based on column types
 Ability to return new non-strongly type DataTable

A more general statement might be to say that DataTable support should
mimic IList support. I'd vote +0 for it. I'm sure it will come in handy
at some point.

--- Ted Husted <te...@gmail.com> wrote:

> On 5/18/05, Brandon Goodin <br...@gmail.com> wrote:
> > As a side note. After having toyed with DataSets... I am hard
> pressed
> > to see their value in the long run. It's like the EJB of the .NET
> > world. It's not neccesarily as complex... but it is certainly full
> of
> > just as much hot air.
> 
> One value I'm running into now is "playing nice with others". 
> 
> We're testing a third-party component, Aspose.Word, 
> 
> * http://www.aspose.com/Products/Aspose.Word/
> 
> and the API uses DataSets and DataTables for the more interesting
> master/child reports.
> 
> Right now, we're using some simple glue code to convert a HashTable
> into a DataTable, so that we can pass it to Aspose.Word. Of course, I
> keep thinking that it would be cool to return a DataTable via a
> ResultSet instead. :)
> 
> In my own use case, I don't need a bidirectional, disconnected
> DataSet. We just need to create a DataTable to pass to this other
> API.
> 
> -Ted.
> 


Re: QueryForDataSet?

Posted by Ted Husted <te...@gmail.com>.
On 5/18/05, Brandon Goodin <br...@gmail.com> wrote:
> As a side note. After having toyed with DataSets... I am hard pressed
> to see their value in the long run. It's like the EJB of the .NET
> world. It's not neccesarily as complex... but it is certainly full of
> just as much hot air.

One value I'm running into now is "playing nice with others". 

We're testing a third-party component, Aspose.Word, 

* http://www.aspose.com/Products/Aspose.Word/

and the API uses DataSets and DataTables for the more interesting
master/child reports.

Right now, we're using some simple glue code to convert a HashTable
into a DataTable, so that we can pass it to Aspose.Word. Of course, I
keep thinking that it would be cool to return a DataTable via a
ResultSet instead. :)

In my own use case, I don't need a bidirectional, disconnected
DataSet. We just need to create a DataTable to pass to this other API.

-Ted.

Re: QueryForDataSet?

Posted by Brandon Goodin <br...@gmail.com>.
Just to give you all some background on Larry. He is one of the
committers on the iBatis Java team. So, he knows the generic reasons
why we would use a iBatis vs. <insert product here>. I'm not saying
this to puff Larry up. I'm simply saying it so you save yourself some
keystrokes and know what level you can communicate with him on.

However, I think your insight of the .NET Collection framework is
intriguing. I really look forward to working with you guys to learn
what your battle hardended .NET development has taught you. I also
look forward to learning why you have chosen to move against the grain
of the DataSet,DataTable and DataRow infatuation.

RE: IBatis being ORM...

IBatis is not ORM. IBatis is data-centric. It is not object centric.
However, this does not mean that we do not consider objects of great
importance. It's just that we give deference to each semantic in it's
proper arena. For example, we do not merely map Objects to Tables. We
map objects into SQL and SQL query results into objects.

This may seem like semantics. But, we do not maintain OID (Object ID).
What this implies is that we do not attempt to create complex dirty
checking scenarios or cache layers that must implore complex
asynchronous update schemes to prevent stale data from living on. Much
of what DataSets and their ORM counterparts attempt to solve we solve
by simply going to the source of "data"... the database. For those
items that are fairly static... just cache it.

Minor Rant:

As a side note. After having toyed with DataSets... I am hard pressed
to see their value in the long run. It's like the EJB of the .NET
world. It's not neccesarily as complex... but it is certainly full of
just as much hot air.

You guys rock!
Brandon


On 5/18/05, Kevin Williams <ke...@bantamtech.com> wrote:
> Larry Meadors wrote:
> 
> > We have a consultant on site, and he is asking if we can get a DataSet
> > out of iBATIS...
> 
> I've been lurking for quite a while without having time to really *try*
> iBatis.NET, but I use other Object-Relational Mapping tools daily. If I
> understand correctly, iBatis is an ORM solution. The idea is to work
> with simple objects designed for the business domain. For example,
> Customer, Order, and OrderItem.
> 
> Both DataSets and mapped objects can be used similarly, but I find
> myself doing more casting and such when I use DataSets. I can type a
> Customer's name as a string and their zip code as an int, but if I use a
> DataSet I might have to cast them to the right type.
> 
> ORM solutions also help me unit test more of my code base. I find it
> easier that way, at least. It's not as easy with straight ADO.NET.
> 
> Ask yourself, and the consultant, what are the trade-offs between the two.
> 
> Hope that helps!
> 
> Cheers,
> 
> Kevin
> 
> ----------
> Scanned for viruses by ClamAV
>

Re: QueryForDataSet?

Posted by Kevin Williams <ke...@bantamtech.com>.
Larry Meadors wrote:

> We have a consultant on site, and he is asking if we can get a DataSet 
> out of iBATIS...

I've been lurking for quite a while without having time to really *try* 
iBatis.NET, but I use other Object-Relational Mapping tools daily. If I 
understand correctly, iBatis is an ORM solution. The idea is to work 
with simple objects designed for the business domain. For example, 
Customer, Order, and OrderItem.

Both DataSets and mapped objects can be used similarly, but I find 
myself doing more casting and such when I use DataSets. I can type a 
Customer's name as a string and their zip code as an int, but if I use a 
DataSet I might have to cast them to the right type.

ORM solutions also help me unit test more of my code base. I find it 
easier that way, at least. It's not as easy with straight ADO.NET.

Ask yourself, and the consultant, what are the trade-offs between the two.

Hope that helps!

Cheers,

Kevin

----------
Scanned for viruses by ClamAV