I’m looking at DataSets in a completely different light after reading what Clemens
Vasters had to say about it. Don’t
use DataSets them on the server side!
Ted
Neward has a crusade against DataSets going on on his blog. At this point in time,
I really only ever use them inside a service and only at times
when I am horribly lazy or when I code under the influence. Otherwise I just go through
the rather quick and mostly painless process of mapping plain data structures (generated
from schema) to and from stored procedure calls myself. More control, more interoperability,
less weight. I really like when my code precisely states how my app interacts
with one of the most important components: the data store.
I don't even use DataSets on ASP.NET web pages anymore. The data binding
logic allows to bind against anything and if I have a public
or protected property "Customer" on my page class that is a data structure, I can
simply have an expression like <%# Customer.Name %> on my page and all
is good. Likewise, a DataGrid happily binds against anything that is an ICollection
(Array, ArrayList, ...) and the DataGridItem.DataItem property will then contain the individual
element. It's just that the design-time support in VS.NET is very DataSet
focused and messes things up when you click the wrong things.
DataSets are really cool for Windows Forms apps. By now I've reached
a point where I simply conclude that the DataSet class should be banned from the server-side.
(c)2003 Clemens Vasters. The opinions expressed herein are personal and do not necessarily
reflect the position of my employer.
This feed is sponsored by newtelligence
AG, a developer services company.
[Clemens
Vasters: Enterprise Development & Alien Abductions]