Main Page | Report Page

 

  .NET DotNet Forum Index » General Discussion » typed datasets vs. business objects

Author Message
BillE
Posted: Thu May 01, 2008 4:09 pm
 
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then bind
it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating, because
it seems like they have to be defined all the way down at the data access
layer to be accessible in a n-tier solution. They clutter up my solution.

Business objects seem tidier, and seem more professional, but are they as
efficient, with all the looping required?

Thanks
Bill
 
Mr. Arnold
Posted: Fri May 02, 2008 12:12 am
 
"BillE" <belgie@datamti.com> wrote in message
news:O1lDq%238qIHA.4912@TK2MSFTNGP03.phx.gbl...
Quote:
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then bind
it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating,
because it seems like they have to be defined all the way down at the data
access layer to be accessible in a n-tier solution. They clutter up my
solution.

Business objects seem tidier, and seem more professional, but are they as
efficient, with all the looping required?


So why can't you just use a Business Object that accesses a DAL object that
brings back the dataset and bind it to the grid's data source? There is
nothing stopping you from doing that. The UI or Presentation tier should not
directly access a database.

There is nothing stopping you from making a DAL object that access a
database table , populate a dataset and return that dataset all the way back
to the UI through the Business Layer and bind the dataset to the control.

As a matter of fact, the UI should totally be unaware of the Business
objects (loosely coupled) UI with the Business Object layer, which is
accomplished with the Presentation layer interfaces that interact with the
Business layer objects. You can send down or bring up things like datasets,
arraylist, strings, List, int. long or whatever through the interface of the
Presentation tier.

What am I talking about?

MODEL-VIEW-PRESENTER

http://www.polymorphicpodcast.com/

click 'Shows'

click 'Design Patterns Bootcamp: Model View * Patterns*

view parts 1-5

But for the example you're presently concerned about, just bring back the
dataset from the DAL to the BUS and bind the dataset to the control.

Busobject bo = new Busobject();

datagrid1,Datasource = bo.GetDataset(); // the DAL returns a dataset to
the BUS and the BUS returns a dataset binds the dataset to the control.
 
John Sheppard
Posted: Fri May 02, 2008 12:59 am
 
"BillE" <belgie@datamti.com> wrote in message
news:O1lDq%238qIHA.4912@TK2MSFTNGP03.phx.gbl...
Quote:
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then bind
it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating,
because it seems like they have to be defined all the way down at the data
access layer to be accessible in a n-tier solution. They clutter up my
solution.

Business objects seem tidier, and seem more professional, but are they as
efficient, with all the looping required?

Thanks
Bill


Im sure behind the scenes datasets loop through things anyway....besides
thats what computers do, they loop...I wouldnt worry to much about that...

I'm by no means a guru. As I have only really experienced datasets, but I
have done lots and lots and lots of reading on them vs custom objects. All
my research can pretty much be sumed up with the following ; Datasets are
excellent for small projects but large and/or complicated projects they just
keep you hemmed in....so for big project it's worth the setup of custom
objects.

My current project is based on datasets and its groovy in some regards, but
its going to become a real pain in the butt later down the track.

The amount of work I have done to just get my datasets generated has been
too much....Draggin and dropping stuff on to xsd every time the DB
changes....ugg...so im trying to generate them and its no easy task.....I
wish we had of gone custom business objects...but then I havent been there
so I cant tell you....but thats where everything points...

I like neat also....it means quicker more readable code...its worth
alot...datasets are by no means neat :(

Hope that helps
John Sheppard
 
Mr. Arnold
Posted: Fri May 02, 2008 6:28 am
 
"John Sheppard" <spam@nospam.com> wrote in message
news:fvealh02tb6@news2.newsguy.com...
Quote:

"BillE" <belgie@datamti.com> wrote in message
news:O1lDq%238qIHA.4912@TK2MSFTNGP03.phx.gbl...
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then
bind it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating,
because it seems like they have to be defined all the way down at the
data access layer to be accessible in a n-tier solution. They clutter up
my solution.

Business objects seem tidier, and seem more professional, but are they as
efficient, with all the looping required?

Thanks
Bill


Im sure behind the scenes datasets loop through things anyway....besides
thats what computers do, they loop...I wouldnt worry to much about that...

I'm by no means a guru. As I have only really experienced datasets, but I
have done lots and lots and lots of reading on them vs custom objects. All
my research can pretty much be sumed up with the following ; Datasets are
excellent for small projects but large and/or complicated projects they
just keep you hemmed in....so for big project it's worth the setup of
custom objects.

My current project is based on datasets and its groovy in some regards,
but its going to become a real pain in the butt later down the track.

The amount of work I have done to just get my datasets generated has been
too much....Draggin and dropping stuff on to xsd every time the DB
changes....ugg...so im trying to generate them and its no easy task.....I
wish we had of gone custom business objects...but then I havent been there
so I cant tell you....but thats where everything points...

I like neat also....it means quicker more readable code...its worth
alot...datasets are by no means neat Sad

Why does this person need a custom business object in an Arraylist of
objects in the case of binding data to a control? If the dataset is being
used in a forward only manner, then simply binding the dataset to the
control is a much cleaner and faster solution.

And I beg to differ with you about a dataset being used in big projects. I
worked at a client site that used an in-house written object code generator
that pointed to SQL based on using stored procedures only, and everything
was generated using datatables and datasets in the DAL. The DAL was used by
Windows Desktop, Windows Service and Web applications, which was also used
in large projects.

A dataset is just a representation of data in memory. That's all it is, and
datasets used in a DAL is just as fast and a viable solution than using
custom objects at the DAL that are not using datasets and datatables, which
one could still customize the code of the DAL that used the DAL database
engine.

It's a mistake using datasets and datatables in the UI in your example
above. The database access should have been extracted from the UI so that
one doesn't face the problems that you are facing or will face for large
projects.
 
RobinS
Posted: Sat May 03, 2008 1:24 am
 
I've done it both ways, and I generally prefer business objects. I have more
control over what's happening. I'd say another factor is if you are using
vs2008 or vs2005, and if you are creating the typed datasets to pull data
from a database, or are just creating them to populate them some other way.

In VS2005, if you used the typed datasets to access the database, and then
had to go add a field, you had to re-create the typed dataset completely.

I think they have divorced this better in VS2008, or at least let you write
your own custom code that you can put in a partial class.

If you want an excellent book on how to do Business Objects w/o going into
Rocky Lhotka's framework stuff, check out Deborah Kurata's "Doing Objects in
VB2005". It shows how to set 'em up, what to put in your base classes, how
to set up the DAL, etc.

RobinS.
GoldMail.com

"BillE" <belgie@datamti.com> wrote in message
news:O1lDq%238qIHA.4912@TK2MSFTNGP03.phx.gbl...
Quote:
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then bind
it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating,
because it seems like they have to be defined all the way down at the data
access layer to be accessible in a n-tier solution. They clutter up my
solution.

Business objects seem tidier, and seem more professional, but are they as
efficient, with all the looping required?

Thanks
Bill



 
Cor Ligthert[MVP]...
Posted: Sun May 04, 2008 2:17 am
 
Bill,

What is your goal to make a sollution or to make something that has the
elitair sound of profesionality.

As soon as you do something that is elitair right, then you are probably
doing something wrong, otherwise it was accepted as well by others then the
bookwritting so called professionals..

(By this I do not mean all bookwritters).

Just my opinion.

Cor

"BillE" <belgie at (no spam) datamti.com> schreef in bericht
news:O1lDq%238qIHA.4912 at (no spam) TK2MSFTNGP03.phx.gbl...
Quote:
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a custom
class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then bind
it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating,
because it seems like they have to be defined all the way down at the data
access layer to be accessible in a n-tier solution. They clutter up my
solution.

Business objects seem tidier, and seem more professional, but are they as
efficient, with all the looping required?

Thanks
Bill



 
John Sheppard...
Posted: Mon May 05, 2008 8:41 pm
 
"Mr. Arnold" <MR. Arnold at (no spam) Arnold.com> wrote in message
news:eT$QieErIHA.3616 at (no spam) TK2MSFTNGP06.phx.gbl...
Quote:

"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvealh02tb6 at (no spam) news2.newsguy.com...

"BillE" <belgie at (no spam) datamti.com> wrote in message
news:O1lDq%238qIHA.4912 at (no spam) TK2MSFTNGP03.phx.gbl...
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I loop
through a datareader, populating an array list with instances of a
custom class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then
bind it to the gridview.

It seems like the typed dataset would be more efficient, because I don't
have to loop through anything. But typed datasets are aggravating,
because it seems like they have to be defined all the way down at the
data access layer to be accessible in a n-tier solution. They clutter
up my solution.

Business objects seem tidier, and seem more professional, but are they
as efficient, with all the looping required?

Thanks
Bill


Im sure behind the scenes datasets loop through things anyway....besides
thats what computers do, they loop...I wouldnt worry to much about
that...

I'm by no means a guru. As I have only really experienced datasets, but I
have done lots and lots and lots of reading on them vs custom objects.
All my research can pretty much be sumed up with the following ; Datasets
are excellent for small projects but large and/or complicated projects
they just keep you hemmed in....so for big project it's worth the setup
of custom objects.

My current project is based on datasets and its groovy in some regards,
but its going to become a real pain in the butt later down the track.

The amount of work I have done to just get my datasets generated has been
too much....Draggin and dropping stuff on to xsd every time the DB
changes....ugg...so im trying to generate them and its no easy task.....I
wish we had of gone custom business objects...but then I havent been
there so I cant tell you....but thats where everything points...

I like neat also....it means quicker more readable code...its worth
alot...datasets are by no means neat :(

Why does this person need a custom business object in an Arraylist of
objects in the case of binding data to a control? If the dataset is being
used in a forward only manner, then simply binding the dataset to the
control is a much cleaner and faster solution.

And I beg to differ with you about a dataset being used in big projects. I
worked at a client site that used an in-house written object code
generator that pointed to SQL based on using stored procedures only, and
everything was generated using datatables and datasets in the DAL. The
DAL was used by Windows Desktop, Windows Service and Web applications,
which was also used in large projects.


Thats exactly what we are doing...its taken me many weeks develop that
inhouse dal. I think it woulda been much quicker to use an orm of some kind
that generates the custom objects.

I am out of my league here tho, I should not have spoken so confidently :S

Quote:
A dataset is just a representation of data in memory. That's all it is,
and datasets used in a DAL is just as fast and a viable solution than
using custom objects at the DAL that are not using datasets and
datatables, which one could still customize the code of the DAL that used
the DAL database engine.


Yeah, I guess I meant to say that just because he isnt writing the looping
code doesnt mean there isnt any there.

Quote:
It's a mistake using datasets and datatables in the UI in your example
above. The database access should have been extracted from the UI so that
one doesn't face the problems that you are facing or will face for large
projects.

What would you bind to if there was no datasets to use at the UI level?

At current we just have one massive dataset which I use bindingsources to
attach to on the UI...

Thank you
John
 
Mr. Arnold...
Posted: Tue May 06, 2008 5:43 pm
 
"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvod2d021e3 at (no spam) news2.newsguy.com...
Quote:

"Mr. Arnold" <MR. Arnold at (no spam) Arnold.com> wrote in message
news:eT$QieErIHA.3616 at (no spam) TK2MSFTNGP06.phx.gbl...

"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvealh02tb6 at (no spam) news2.newsguy.com...

"BillE" <belgie at (no spam) datamti.com> wrote in message
news:O1lDq%238qIHA.4912 at (no spam) TK2MSFTNGP03.phx.gbl...
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I
loop through a datareader, populating an array list with instances of a
custom class in the middle tier, and then send the array list up to the
presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then
bind it to the gridview.

It seems like the typed dataset would be more efficient, because I
don't have to loop through anything. But typed datasets are
aggravating, because it seems like they have to be defined all the way
down at the data access layer to be accessible in a n-tier solution.
They clutter up my solution.

Business objects seem tidier, and seem more professional, but are they
as efficient, with all the looping required?

Thanks
Bill


Im sure behind the scenes datasets loop through things anyway....besides
thats what computers do, they loop...I wouldnt worry to much about
that...

I'm by no means a guru. As I have only really experienced datasets, but
I have done lots and lots and lots of reading on them vs custom objects.
All my research can pretty much be sumed up with the following ;
Datasets are excellent for small projects but large and/or complicated
projects they just keep you hemmed in....so for big project it's worth
the setup of custom objects.

My current project is based on datasets and its groovy in some regards,
but its going to become a real pain in the butt later down the track.

The amount of work I have done to just get my datasets generated has
been too much....Draggin and dropping stuff on to xsd every time the DB
changes....ugg...so im trying to generate them and its no easy
task.....I wish we had of gone custom business objects...but then I
havent been there so I cant tell you....but thats where everything
points...

I like neat also....it means quicker more readable code...its worth
alot...datasets are by no means neat :(

Why does this person need a custom business object in an Arraylist of
objects in the case of binding data to a control? If the dataset is
being used in a forward only manner, then simply binding the dataset to
the control is a much cleaner and faster solution.

And I beg to differ with you about a dataset being used in big projects.
I worked at a client site that used an in-house written object code
generator that pointed to SQL based on using stored procedures only, and
everything was generated using datatables and datasets in the DAL. The
DAL was used by Windows Desktop, Windows Service and Web applications,
which was also used in large projects.


Thats exactly what we are doing...its taken me many weeks develop that
inhouse dal. I think it woulda been much quicker to use an orm of some
kind that generates the custom objects.

It took me all of 10 minutes to complete any code in the DAL using datasets
and datatables. The in-house written code generator created the DAL objects
that the in-house written database engine used. What I mean is someone wrote
the code to access SQL Server tables to create the primitive field types,
etc, etc. Someone wrote the (DLL) code for the database engine that was
inplemented in each DAL object. In other words, it was short of an ORM
application that was in-house written and worked well.

Quote:

I am out of my league here tho, I should not have spoken so confidently :S

A dataset is just a representation of data in memory. That's all it is,
and datasets used in a DAL is just as fast and a viable solution than
using custom objects at the DAL that are not using datasets and
datatables, which one could still customize the code of the DAL that used
the DAL database engine.


Yeah, I guess I meant to say that just because he isnt writing the looping
code doesnt mean there isnt any there.

It's a mistake using datasets and datatables in the UI in your example
above. The database access should have been extracted from the UI so that
one doesn't face the problems that you are facing or will face for large
projects.

What would you bind to if there was no datasets to use at the UI level?

The mistake is if you are making direct calls from the UI to the database.
If you are going through UI-BL-DAL, that's not a problem. Direct database
access should be extracted from the UI.
Quote:

At current we just have one massive dataset which I use bindingsources to
attach to on the UI...


Really? That's kind of ugly. But it's all in one dataset in memory. What
happens when you have to update or insert records into a database?
 
John Sheppard...
Posted: Tue May 06, 2008 8:27 pm
 
"Mr. Arnold" <MR. Arnold at (no spam) Arnold.com> wrote in message
news:e74Lqq8rIHA.3940 at (no spam) TK2MSFTNGP03.phx.gbl...
Quote:

"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvod2d021e3 at (no spam) news2.newsguy.com...

"Mr. Arnold" <MR. Arnold at (no spam) Arnold.com> wrote in message
news:eT$QieErIHA.3616 at (no spam) TK2MSFTNGP06.phx.gbl...

"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvealh02tb6 at (no spam) news2.newsguy.com...

"BillE" <belgie at (no spam) datamti.com> wrote in message
news:O1lDq%238qIHA.4912 at (no spam) TK2MSFTNGP03.phx.gbl...
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I
loop through a datareader, populating an array list with instances of
a custom class in the middle tier, and then send the array list up to
the presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then
bind it to the gridview.

It seems like the typed dataset would be more efficient, because I
don't have to loop through anything. But typed datasets are
aggravating, because it seems like they have to be defined all the way
down at the data access layer to be accessible in a n-tier solution.
They clutter up my solution.

Business objects seem tidier, and seem more professional, but are they
as efficient, with all the looping required?

Thanks
Bill


Im sure behind the scenes datasets loop through things
anyway....besides thats what computers do, they loop...I wouldnt worry
to much about that...

I'm by no means a guru. As I have only really experienced datasets, but
I have done lots and lots and lots of reading on them vs custom
objects. All my research can pretty much be sumed up with the following
; Datasets are excellent for small projects but large and/or
complicated projects they just keep you hemmed in....so for big project
it's worth the setup of custom objects.

My current project is based on datasets and its groovy in some regards,
but its going to become a real pain in the butt later down the track.

The amount of work I have done to just get my datasets generated has
been too much....Draggin and dropping stuff on to xsd every time the DB
changes....ugg...so im trying to generate them and its no easy
task.....I wish we had of gone custom business objects...but then I
havent been there so I cant tell you....but thats where everything
points...

I like neat also....it means quicker more readable code...its worth
alot...datasets are by no means neat :(

Why does this person need a custom business object in an Arraylist of
objects in the case of binding data to a control? If the dataset is
being used in a forward only manner, then simply binding the dataset to
the control is a much cleaner and faster solution.

And I beg to differ with you about a dataset being used in big projects.
I worked at a client site that used an in-house written object code
generator that pointed to SQL based on using stored procedures only, and
everything was generated using datatables and datasets in the DAL. The
DAL was used by Windows Desktop, Windows Service and Web applications,
which was also used in large projects.


Thats exactly what we are doing...its taken me many weeks develop that
inhouse dal. I think it woulda been much quicker to use an orm of some
kind that generates the custom objects.

It took me all of 10 minutes to complete any code in the DAL using
datasets and datatables. The in-house written code generator created the
DAL objects that the in-house written database engine used. What I mean is
someone wrote the code to access SQL Server tables to create the primitive
field types, etc, etc. Someone wrote the (DLL) code for the database
engine that was inplemented in each DAL object. In other words, it was
short of an ORM application that was in-house written and worked well.


I am out of my league here tho, I should not have spoken so confidently
:S

A dataset is just a representation of data in memory. That's all it is,
and datasets used in a DAL is just as fast and a viable solution than
using custom objects at the DAL that are not using datasets and
datatables, which one could still customize the code of the DAL that
used the DAL database engine.


Yeah, I guess I meant to say that just because he isnt writing the
looping code doesnt mean there isnt any there.

It's a mistake using datasets and datatables in the UI in your example
above. The database access should have been extracted from the UI so
that one doesn't face the problems that you are facing or will face for
large projects.

What would you bind to if there was no datasets to use at the UI level?

The mistake is if you are making direct calls from the UI to the database.
If you are going through UI-BL-DAL, that's not a problem. Direct database
access should be extracted from the UI.

ahh ic...yeah nah thats how we are doing it...UI-BL-DAL..

Quote:

At current we just have one massive dataset which I use bindingsources to
attach to on the UI...


Really? That's kind of ugly. But it's all in one dataset in memory. What
happens when you have to update or insert records into a database?


Its ugly Smile Very ugly...somewhere along the line I'd imagine I will be
forced to break it up, but for now it works well enough.

To persist it to the database I just loop through the dataset using
getchanges and execute an autogenerated sql statement for each one thats had
a change. It's not exactly efficient but it's working so far although I
*suspect* I will start having problems somewhere down the line...

It's on a webservice which complicated things, but getting all that stuff
working took me mroe time than I would have liked and I just figured I would
have been better off just paying for an ORM.

I guess put it this way; I don't feel 100% confident that im not going to
run into problems with my dataset architecture. I feel more confident with
an orm and custom objects because thats what seems to be what most blogs
live and die by, so I figure there must be a reason :)

Regards
John
 
Cor Ligthert[MVP]...
Posted: Wed May 07, 2008 11:37 pm
 
Hi,

Mr. Arnold,

In my idea you give some generalized own opinions, which can be true,
however not forever.

If you use an application that uses a database, that has one table and one
UI, then we are in my idea in another situation then where we have a
database with thousand tables and thousand of UI's.

In the first situation code seperated in layers give awful readable code.

In my idea we should never generalise.

Cor

"Mr. Arnold" <MR. Arnold at (no spam) Arnold.com> schreef in bericht
news:e74Lqq8rIHA.3940 at (no spam) TK2MSFTNGP03.phx.gbl...
Quote:

"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvod2d021e3 at (no spam) news2.newsguy.com...

"Mr. Arnold" <MR. Arnold at (no spam) Arnold.com> wrote in message
news:eT$QieErIHA.3616 at (no spam) TK2MSFTNGP06.phx.gbl...

"John Sheppard" <spam at (no spam) nospam.com> wrote in message
news:fvealh02tb6 at (no spam) news2.newsguy.com...

"BillE" <belgie at (no spam) datamti.com> wrote in message
news:O1lDq%238qIHA.4912 at (no spam) TK2MSFTNGP03.phx.gbl...
I'm trying to decide if it is better to use typed datasets or business
objects, so I would appreciate any thoughts from someone with more
experience.

When I use a business object to populate a gridview, for example, I
loop through a datareader, populating an array list with instances of
a custom class in the middle tier, and then send the array list up to
the presentation layer and bind the gridview to it.

If I use a typed dataset, I just fill it with a data adapter and then
bind it to the gridview.

It seems like the typed dataset would be more efficient, because I
don't have to loop through anything. But typed datasets are
aggravating, because it seems like they have to be defined all the way
down at the data access layer to be accessible in a n-tier solution.
They clutter up my solution.

Business objects seem tidier, and seem more professional, but are they
as efficient, with all the looping required?

Thanks
Bill


Im sure behind the scenes datasets loop through things
anyway....besides thats what computers do, they loop...I wouldnt worry
to much about that...

I'm by no means a guru. As I have only really experienced datasets, but
I have done lots and lots and lots of reading on them vs custom
objects. All my research can pretty much be sumed up with the following
; Datasets are excellent for small projects but large and/or
complicated projects they just keep you hemmed in....so for big project
it's worth the setup of custom objects.

My current project is based on datasets and its groovy in some regards,
but its going to become a real pain in the butt later down the track.

The amount of work I have done to just get my datasets generated has
been too much....Draggin and dropping stuff on to xsd every time the DB
changes....ugg...so im trying to generate them and its no easy
task.....I wish we had of gone custom business objects...but then I
havent been there so I cant tell you....but thats where everything
points...

I like neat also....it means quicker more readable code...its worth
alot...datasets are by no means neat :(

Why does this person need a custom business object in an Arraylist of
objects in the case of binding data to a control? If the dataset is
being used in a forward only manner, then simply binding the dataset to
the control is a much cleaner and faster solution.

And I beg to differ with you about a dataset being used in big projects.
I worked at a client site that used an in-house written object code
generator that pointed to SQL based on using stored procedures only, and
everything was generated using datatables and datasets in the DAL. The
DAL was used by Windows Desktop, Windows Service and Web applications,
which was also used in large projects.


Thats exactly what we are doing...its taken me many weeks develop that
inhouse dal. I think it woulda been much quicker to use an orm of some
kind that generates the custom objects.

It took me all of 10 minutes to complete any code in the DAL using
datasets and datatables. The in-house written code generator created the
DAL objects that the in-house written database engine used. What I mean is
someone wrote the code to access SQL Server tables to create the primitive
field types, etc, etc. Someone wrote the (DLL) code for the database
engine that was inplemented in each DAL object. In other words, it was
short of an ORM application that was in-house written and worked well.


I am out of my league here tho, I should not have spoken so confidently
:S

A dataset is just a representation of data in memory. That's all it is,
and datasets used in a DAL is just as fast and a viable solution than
using custom objects at the DAL that are not using datasets and
datatables, which one could still customize the code of the DAL that
used the DAL database engine.


Yeah, I guess I meant to say that just because he isnt writing the
looping code doesnt mean there isnt any there.

It's a mistake using datasets and datatables in the UI in your example
above. The database access should have been extracted from the UI so
that one doesn't face the problems that you are facing or will face for
large projects.

What would you bind to if there was no datasets to use at the UI level?

The mistake is if you are making direct calls from the UI to the database.
If you are going through UI-BL-DAL, that's not a problem. Direct database
access should be extracted from the UI.

At current we just have one massive dataset which I use bindingsources to
attach to on the UI...


Really? That's kind of ugly. But it's all in one dataset in memory. What
happens when you have to update or insert records into a database?

 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sat May 28, 2016 7:02 pm