473,725 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2238
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*********@ya hoo.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3083
by: Patrick Kearney | last post by:
Hi All, I have seen this type of question raised in various groups but no one has supplied a definitive answer. I am trying to load a dataset schema that has an xs:include. Project policy is to have all schemas as embedded resources but there appears to be no means by which the DataSet.ReadXmlSchema method can be induced to use a custom Xmlresolver in order to supply the embedded referenced schema. I have tried passing a custom resolver to...
6
2665
by: Boaz Ben-Porat | last post by:
I heard somewhere that the DataGrid class is implemented as a XML graph in memory. Is this true ? TIA Boaz Ben-Porat DataPharm a/s Denmark
0
1344
by: Craig | last post by:
Does anyone know whether you can take a dataset and serialise into a custom collection? Over the past couple of months I've been retreiving my datasets and manually iterating them to create my custom object based upon field 1, field 2 etc then adding that manally to my custom collection. This seems to be an Order N process, and it just _feels_ wrong. Anyone know of a Order 1 way to do this?
3
2052
by: Ben Becker | last post by:
I am trying to build a custom crosstab type of grid where I take some items in a data grid and based on the content of the current item compared to the previous item, determine if a new row in a table should be created or not. In order to do this, I need to have full control over the conditional logic for how items get displayed within a repeater element which I'm not seeing as possible. How can I cursor through a data set, apply...
4
3460
by: _DS | last post by:
I need to create arrays of a custom data type (which is composed of various strings, ints, the usual). The original was built using CollectionBase. I was thinking about redesigning to use generics, but I realized that DataSets may also work here. I do need to display and edit lists of the items at various places. In the previous version I used a custom ListView for most display purposes. Given that DataSets in VS2005 have so many...
6
5548
by: npaulus | last post by:
Hi, DataSets are usually resource heavy. Instead of having to pass them from my middle tier to my presentation layer I was wondering if anyone has developed a custom collection object that is less resource heavy and can be passed lightweight to the presentation layer. Thanks, NJ
2
4886
by: Emma Burrows | last post by:
I have created a typed dataset in .Net 2.0 based on an Access database, and set up various methods to retrieve specific data from the tables, etc (great fun). However, I need to implement a custom sort order on a text column. I know how to implement this in an IComparer and apply it to a custom collection or an array, but I don't see an easy way to tie this up with my strongly typed dataset (short of adding the extra step of feeding it into...
13
2366
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
5
3484
by: Simon Woods | last post by:
Hi Does anyone know if there any dotnet software out there which converts a dataset into a collection of custom objects, programmatically i.e. actually creates the class structure and collection class on-the-fly based on the fields in the dataset and then creates and populates the classes and adds them into the collection. Thanks
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8096
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.