ObjectDataSource and DataSets

C

Chris Fulstow

Hi all,

I'm investigating the best approach for building an n-tier web
application with ASP.NET 2.0. I want to separate my data access layer,
so an ObjectDataSource seems the natural choice, but I can't decide
whether to supply it data from a custom business object, or a DataSet
created with the DataSet designer.

Any thoughts?

Chris
 
S

sloan

I had this same choice .... a few months back.


On one screen, where I have 3 items to do a Sort (lets say I have 3
comboboxes where each box has 3 items... LastName , FirstName, BirthDate )
and I want to give the user the option of selecting the order they want...
by making choices.

I used a dataset here, because I could use the DataSet.Table.Select("")
method .. and then rebind to the ObjectDataSource.

However, I only switched out to the DataSet because of this one tricky
little item. I preferred to have used a CollectionBase... populated by a
IDataReader.

If you only need simple sorting .. (like clicking the header of the
GridView) then you probably can by pass the DataSet.

...

One other consideration.. if you have related data., lets say you have 1000
emps and 10 depts they work in. Sometimes I pick the dataset over the
custom collection...since I can "reuse" the single list of depts (aka, I
don't have to assign each Employee object ... a property/collection of 10
depts ... thus keep a record of 1000x10 depts).

Ok.. that's probably not the clearest post I've ever made, but hopefully
there is something in there.

I usually pick custom collection....custom business objects... over
DataSets, unless I have a specific reason not to.


PS

I am not crossposting this to
microsoft.public.dotnet.framework.adonet

I am only posting it to .aspnet
 
M

MSDN

Chris,

I would use the business layer to indirectly supply me with data, depending
on your security needs.
If you are dealing with secure data then let the security section of the
business layer deal with it since you might not want to fully trust the
front end developers.
if you want n-tier then use it.
At times you might mix but it all depends.

SA
 
J

Joerg Jooss

Thus wrote Chris,
Hi all,

I'm investigating the best approach for building an n-tier web
application with ASP.NET 2.0. I want to separate my data access
layer, so an ObjectDataSource seems the natural choice, but I can't
decide whether to supply it data from a custom business object, or a
DataSet created with the DataSet designer.

Any thoughts?

It really depends on your requirements. If your applicaton more or less offers
simple CRUD functionality for some underlying database tables, DataSets can
save you a lot of work. See also http://msdn.microsoft.com/practices...spx?pull=/library/en-us/dnbda/html/boagag.asp
for a thorough discussion of this topic.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top