Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DAL "Typed DataSets" or Custom Business Object

Tags:

c#

.net

asp.net

I would like your opinions regarding "DataSet Designer" and DAL (Data Access Layer) best practices. I use Visual Studio 2010 Framework .NEt 4.0.

For my understanding "DataSet Designer" allow me to create automatically strictly Typed-DataSet with DataTable and Adapter, this consist in DAL directly in Visual Studio 2010.

I would like to know: - If in real scenario "DataSet Designer" is working well, or is better write Custom Business Object. - If exist other new solution introduced in .net 4.0

Thanks for your support! :-)

like image 634
GibboK Avatar asked Aug 30 '10 13:08

GibboK


3 Answers

I have to work with typed datasets and it is a nightmare. If you have an option never use them. Everything is better.

like image 97
Ladislav Mrnka Avatar answered Oct 02 '22 03:10

Ladislav Mrnka


With the advent of the .Net 4.0 framework and the introduction of LINQ to SQL, I've been adopting a customized DAL of strictly written business objects. We experimented with Entity Framework briefly, but ultimately concluded that it is very similar to DataSets in that the auto-generated code, while handy, is just too bloated with extra junk that we ultimately didn't use.

We've found that writing LINQ into our DAL and extracting data pulls into our custom classes, we are able to streamline our data access and control the usage of the data functionally. It has been a very handy process, but it has taken a little bit for the junior developers to grip onto it.

like image 35
Joel Etherton Avatar answered Oct 02 '22 02:10

Joel Etherton


I would suggest a ORM like Entity Framework or Nhibernate.

Data Sets smells too much to database way of thinking and I personally had a lot of problems working with them. They just get broken quite often and throw weird errors that are hard to troubleshoot.

Some other related questions you may find interesting

What are the advantages of using an ORM?

ASP.NET DataSet vs Business Objects / ORM

like image 24
Claudio Redi Avatar answered Oct 02 '22 03:10

Claudio Redi