Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - typed datasets vs. business objects

Reply
 
Old 05-01-2008   #1 (permalink)
BillE


 
 

typed datasets vs. business objects

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




My System SpecsSystem Spec
Old 05-02-2008   #2 (permalink)
Mr. Arnold


 
 

Re: typed datasets vs. business objects


"BillE" <belgie@xxxxxx> wrote in message
news:O1lDq%238qIHA.4912@xxxxxx
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.







My System SpecsSystem Spec
Old 05-02-2008   #3 (permalink)
John Sheppard


 
 

Re: typed datasets vs. business objects


"BillE" <belgie@xxxxxx> wrote in message
news:O1lDq%238qIHA.4912@xxxxxx
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



My System SpecsSystem Spec
Old 05-02-2008   #4 (permalink)
Mr. Arnold


 
 

Re: typed datasets vs. business objects


"John Sheppard" <spam@xxxxxx> wrote in message
news:fvealh02tb6@xxxxxx
Quote:

>
> "BillE" <belgie@xxxxxx> wrote in message
> news:O1lDq%238qIHA.4912@xxxxxx
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
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.

My System SpecsSystem Spec
Old 05-03-2008   #5 (permalink)
RobinS


 
 

Re: typed datasets vs. business objects

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@xxxxxx> wrote in message
news:O1lDq%238qIHA.4912@xxxxxx
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
>
>
>
My System SpecsSystem Spec
Old 05-04-2008   #6 (permalink)
Cor Ligthert[MVP]


 
 

Re: typed datasets vs. business objects

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@xxxxxx> schreef in bericht
news:O1lDq%238qIHA.4912@xxxxxx
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
>
>
>
My System SpecsSystem Spec
Old 05-05-2008   #7 (permalink)
sloan


 
 

Re: typed datasets vs. business objects


Outside of Reporting, I use custom business objects 99.9% of the time.

Here is an example:
http://sholliday.spaces.live.com/Blo...842A!139.entry

Find the MS article I mention here ("bird's eye view") and read that thing
about 4 times.

...

SOMEBODY has to pay the looping price. Just because in a DataSet you're
encapsulated from it, the DataSet is being internally populated (via
looping) with an IDataReader.

Get the download code from the URL above. Somewhere I have a test that
shows the difference between a CustomCollection being populated, and a
DataSet (with constaints ON) and a DataSet (with constraints turned OFF).

I think the results will surprise you.

...

I wouldn't go back to a purely dataset model for ... an extra $30K salary.
They're such a pain in the butt, esp with Generics.
And finding data in a DataSet.Table with the el-crappo .Select method sucks.


PS

In 2.0, you'd be better off (IMHO, I know others may disagree) defined
something like:

public EmployeeCollection : List<Employee>
{
//that's it, that's all the code
}

instead of a return ArrayList.




At my blog above, I have a 2.0 version of that article.
Also check out my WCF/Interfaces blog entry, and just ignore the WCF stuff.
I have interfaces and custom objects/collections defined there.

IZebra
IZebraCollection
Zebra
ZebraCollection


...



"BillE" <belgie@xxxxxx> wrote in message
news:O1lDq%238qIHA.4912@xxxxxx
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
>
>
>

My System SpecsSystem Spec
Old 05-05-2008   #8 (permalink)
John Sheppard


 
 

Re: typed datasets vs. business objects


"Mr. Arnold" <MR. Arnold@xxxxxx> wrote in message
news:eT$QieErIHA.3616@xxxxxx
Quote:

>
> "John Sheppard" <spam@xxxxxx> wrote in message
> news:fvealh02tb6@xxxxxx
Quote:

>>
>> "BillE" <belgie@xxxxxx> wrote in message
>> news:O1lDq%238qIHA.4912@xxxxxx
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
>
> 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


My System SpecsSystem Spec
Old 05-06-2008   #9 (permalink)
Mr. Arnold


 
 

Re: typed datasets vs. business objects


"John Sheppard" <spam@xxxxxx> wrote in message
news:fvod2d021e3@xxxxxx
Quote:

>
> "Mr. Arnold" <MR. Arnold@xxxxxx> wrote in message
> news:eT$QieErIHA.3616@xxxxxx
Quote:

>>
>> "John Sheppard" <spam@xxxxxx> wrote in message
>> news:fvealh02tb6@xxxxxx
Quote:

>>>
>>> "BillE" <belgie@xxxxxx> wrote in message
>>> news:O1lDq%238qIHA.4912@xxxxxx
>>>> 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
>
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?
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?

My System SpecsSystem Spec
Old 05-06-2008   #10 (permalink)
John Sheppard


 
 

Re: typed datasets vs. business objects


"Mr. Arnold" <MR. Arnold@xxxxxx> wrote in message
news:e74Lqq8rIHA.3940@xxxxxx
Quote:

>
> "John Sheppard" <spam@xxxxxx> wrote in message
> news:fvod2d021e3@xxxxxx
Quote:

>>
>> "Mr. Arnold" <MR. Arnold@xxxxxx> wrote in message
>> news:eT$QieErIHA.3616@xxxxxx
Quote:

>>>
>>> "John Sheppard" <spam@xxxxxx> wrote in message
>>> news:fvealh02tb6@xxxxxx
>>>>
>>>> "BillE" <belgie@xxxxxx> wrote in message
>>>> news:O1lDq%238qIHA.4912@xxxxxx
>>>>> 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
>>
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?
>
> 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:
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 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



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Typed datasets and table table adapters components not showing inToolbox .NET General
Error Provider and Business Objects Validation - VB2005 .NET General
Business Objects is ready for Vista or not. Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46