469,299 Members | 2,073 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,299 developers. It's quick & easy.

DataSet vs Custom Collection

We are designing a WinForm application ( three tiered)
There is a debate in our group as to whether we should pass datasets or
our custom collections from business layer to the user interface layer.
The data is stored in memory (fetched from DB only once). The
collection is dynamic in the sense that it can change.
My personal opinion is that using dataset makes you code take much more
memory than a custom collection. Datasets have overheads that you may
not want (or get) if u use your custom collections.
Am I right? Can someone throw some light on this topic

Nov 19 '05 #1
3 1991
Hi,

This is a question that comes up alot. I can't tell you how often I see
people over design an application and introduce totally uncessary
complexity. Because I don't have the specifics on your application, I
am going to assume that you are not building something that is going to
lift the space shuttle. Having said that, I have written applications
that do both and are termed "big applications". Since you are working
in a WinForms application, I definitely say go with the DataSet because
you will have the processing power of the client at your fingertips.
The DataSet has allot of cool functionality that you are going to have
to reinvent as the application grows. If you are really leaning toward
collections, I would still suggest you start with the DataSet and hide
it behind an interface so you can swap it with a collection if you have
to.

To that end, are you building a smart client application? If so, then
the DataSet is even better because it offers the facility to read and
write to XML (as you probably already know) to support offline
capabilities. Anyway, people always bring up the size and possible
performance issues with DataSets and it scares people into not using it
because they think their application has to perform. I say use the
DataSet but combine it with the Caching Application Block if you are
concerned with performance; although I have never seen a problem with
it.

Thanks,

Sayed Y. Hashimi

http://www.sayedhashimi.com
Shameless Book Plug: Service-Oriented Smart Clients with .NET 2.0
http://www.amazon.com/exec/obidos/tg...glance&s=books

Nov 19 '05 #2
"JimGreen" <ji*********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
We are designing a WinForm application ( three tiered)
There is a debate in our group as to whether we should pass datasets or
our custom collections from business layer to the user interface layer.
The data is stored in memory (fetched from DB only once). The
collection is dynamic in the sense that it can change.
My personal opinion is that using dataset makes you code take much more
memory than a custom collection. Datasets have overheads that you may
not want (or get) if u use your custom collections.
Am I right? Can someone throw some light on this topic


There are indeed performance differences between DataSets and custom
collections. But these differences are not so large or simple that
performance can be used as a valid design criterion based on the information
you have provided. Memory usage is usually similar, serialization is
cheaper for custom objects (at least until .NET 2.0), indexing, searching,
filtering and data binding is cheaper with DataSets.

There are design tradeoffs related to DataSets and ease-of-use tradeoffs
related to DataSets. These are the issues which should drive design
desitions. The performance tradeoffs are usually just a tie-breaker.

David
Nov 19 '05 #3
you can fine tune datasets even typed ones to certain degre. in a winforms
application i agree with you, implementing IBindingList and other issues are
not easy to implement, but with a web application i suggest inheriting your
base collection to collectionbase and add common functionalty to it and then
inherit from that collection for each entity and add custom behaviour, maybe
database read operations to that strongly typed collection.
Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Patrick Kearney | last post: by
6 posts views Thread by Boaz Ben-Porat | last post: by
6 posts views Thread by npaulus | last post: by
2 posts views Thread by Emma Burrows | last post: by
13 posts views Thread by Maxwell2006 | last post: by
5 posts views Thread by Simon Woods | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.