473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Using classes/properties vs datasets

We're designing an app and see two basic ways to return data from the
business tier to the client:

1) Everything in DataSets
2) Fill properties of objects and manage accordingly

Any opinions as to overall approach?

Thanks.

May 3 '07 #1
5 1586
We're designing an app and see two basic ways to return data from the
business tier to the client:

1) Everything in DataSets
2) Fill properties of objects and manage accordingly

Any opinions as to overall approach?
There are pros and cons to both techniques but in the long term it's
normally much better to abstract everything away. Option 2 will likely
require more work but is almost always the better choice in my (long)
experience. You can manage a "DataSet" behind the scenes if it serves your
purpose but the interface that clients deal with should say nothing about
how the data is actually stored. The entire system should be designed so
that you can replace the "DataSet" with something else later on without
impacting your clients. This promotes clean and stable code even if you
never have to do this.
May 3 '07 #2
Ronald,

Personally, I like everything in DataSets, as I don't like having to
write up all the code for my data container. I also prefer to have the
operations on the data separated from the data container itself, given that
I find it fits more with transactional processing.

However, that's not an argument against using your own objects, and
possibly placing methods to perform work on those objects. DataSets have
their own shortcomings. Particularly, for large sets of data, they can be
inefficient, and managing relations isn't as intuitive as using an object
heiarchy.

There are many more pros and cons to each side. What are your
requirements or concerns? It would probably be easier to work from those as
opposed to asking for a side-by-side comparison.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ronald S. Cook" <rc***@westinis.comwrote in message
news:ea**************@TK2MSFTNGP02.phx.gbl...
We're designing an app and see two basic ways to return data from the
business tier to the client:

1) Everything in DataSets
2) Fill properties of objects and manage accordingly

Any opinions as to overall approach?

Thanks.

May 3 '07 #3
I'm an OO person myself; I like (proper) objects. Along with the other
arguments mentioned, I like (perhaps as a minority) that it divorces
the data entities from the database; OO and RDMBS are different things
and should be (IMO) represented as such. This allows me to use the
objects in an architecture-neutral, SOA fashion - (e.g. over WCF etc)
- without prejudice. It also allows me a *lot* more freedom to monkey
with the gubbins - i.e. messing around with the
TypeDescriptionProvider for a custom view etc; all of which are hard
to do with DataSets.

However, I am also a pragmatist, and I need to get the job done. If
all I am doing is returning simple data (e.g. for search results
before the "full" objects are fetched) then I will happily use a
DataTable in the same design. I'm fickle like that ;-p This allows
simple flexibility (right or wrong) in terms of which columns I bring
back - e.g. a UI search might need a lot more data than a system
search.

But Nicholas has the right of it when he asks about your requirements
and concerns. Always design around the requirements (taking best
practice into account).

Marc

May 3 '07 #4
One more thing you should consider is the need for serializing data. With
DataSet you don't have to bother, but with you own implemtation, you have to
take this into acount. But again, as Nicholas said, you had to take into
considerations the requirements you have in your application.

Regards,
Tibi
MCT, MCPD

"Ronald S. Cook" <rc***@westinis.comwrote in message
news:ea**************@TK2MSFTNGP02.phx.gbl...
We're designing an app and see two basic ways to return data from the
business tier to the client:

1) Everything in DataSets
2) Fill properties of objects and manage accordingly

Any opinions as to overall approach?

Thanks.
May 3 '07 #5
Thanks guys.. great feedback.
"Tiberiu Covaci" <tibi AT covaci DOT netwrote in message
news:E2**********************************@microsof t.com...
One more thing you should consider is the need for serializing data. With
DataSet you don't have to bother, but with you own implemtation, you have
to take this into acount. But again, as Nicholas said, you had to take
into considerations the requirements you have in your application.

Regards,
Tibi
MCT, MCPD

"Ronald S. Cook" <rc***@westinis.comwrote in message
news:ea**************@TK2MSFTNGP02.phx.gbl...
>We're designing an app and see two basic ways to return data from the
business tier to the client:

1) Everything in DataSets
2) Fill properties of objects and manage accordingly

Any opinions as to overall approach?

Thanks.

May 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kevin_Eld | last post by:
I have the following xml: <message> <envelope> <body key="" value="" /> </envelope> </message> I have associated an xsd to this xml in order to use the XmlDataDocument and give me the
1
by: Aidan Glendye | last post by:
Hi, I am trying to store various objects within session. Due to the site being hosted in a web farm we are going to have to use either State Server or SQL Server to persist the data in...
3
by: Chris Dunaway | last post by:
How can a class be shared between a web service and a client that consumes the web service? Suppose I have a Class Libraray with the following simple class: Public Class SimpleClass Private...
2
by: David | last post by:
Hi all, This is the first time I have tried this and so far, it seems to work, but for me, unexpectedly. I have code similar to... namespace Dave.MyGenerator { public class FirstClass
12
by: Michael Maes | last post by:
Hi, What would be the best way to Set a property of a class which you don't know at design-time which that would be? The classes haven't got the same base-class, but they're all "extended" with...
16
by: Dennis | last post by:
I have a class named "myclass" and an arraylist containing elements of type "MyClass". I want to get the value of a property of "MyClass" (a string type) for one of the arraylist elements. I...
19
by: Larry Lard | last post by:
In the old days (VB3 era), there was a thing called the Data Control, and you could use it to databind controls on forms to datasources, and so (as the marketing speak goes), 'create database...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
5
by: jehugaleahsa | last post by:
Hello: I am trying to find what is the very best approach to business objects in Windows Forms. Windows Forms presents an awesome opportunity to use DataTables and I would like to continue doing...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.