Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Entity Framework 4 vs Dataset

Posted on 2011-04-25
7
Medium Priority
?
611 Views
Last Modified: 2013-11-12
Hello,

I'm looking to put together a decision tree, pros and cons, type of document regarding .NET 4 Entity Framework vs Datasets.

Can you please share your decision strategy or point to some interesting sources?

Thanks very much,
-Bill
0
Comment
Question by:Bill732
7 Comments
 
LVL 20

Expert Comment

by:hes
ID: 35460402
0
 

Author Comment

by:Bill732
ID: 35467695
Hi hes,

Thanks very much for responding. Yes, I saw that one, it was a good thread.

So these observations seem in the right direction?:

Datasets are best when you want to bring down most of your data (disconnected) to a desktop client, as in WPF, to work with and so reduce your trips to the dataserver. But they can be more difficult to maintain as the data configuration changes.

EF 4 models are easier to maintain as the data changes but there is an overhead performance hit that maybe noticeable in the application (translating the data into the data model each time). Also there will be more trips to the data server (but for smaller amounts of data) but you can use a caching scheme to have it perform more like the disconnected datasets.
(?)
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:Bill732
ID: 35467803
Hello IJZ,

Yes, I saw those, thanks! I also saw a good video presentation from teched 2010 that said Datasets are not going away, but Microsoft is encouraging developers to use EF4 with new applications.

I have used datasets and found some nice things, such as how easy it is to implement sorting with the table adapter; using the relations between tables, and having the data available on the client.

I have not used EF 4 yet. I believe it will be a little more work to implement the sorting but not a show stopper. I don't know yet about implementing disconnected data scenario. It also looks like there are really nice features that will cut down on development and maintenance time.
0
 
LVL 13

Expert Comment

by:jonnidip
ID: 36201413
I never used Entity Framework, but I can say you my experience.
I think that most of the times the best solution is in the middle.
You will hear that Dataset is "expensive" (and I think it too, because it keeps in memory the previous version of the rows, you usually do not need it).
But I sometimes use Datasets (or better, Datatable) for my little-onetime-objects. I use them when I don't want (need) to create a Class (entity, I say) describing that object.

The solution for me is to manually create entities as the optimized way to work with my data.
Then use Datasets when I don't need entities (for example, if I need to fill a dropdown box with static values).

My thinking is that being "radical" can easily be the worst choice.
Allow your code to be "standard", but at the same time try to take the advantage of new technologies.


Hope this helps.
0
 

Accepted Solution

by:
Bill732 earned 0 total points
ID: 37670747
I need close this question. I appreciate the responses with the links, but I was hoping for someone to provide their own experiences with EF4.

I have now used EF4 and find it to be the preferred way to go when creating MS object oriented applications.
0
 

Author Closing Comment

by:Bill732
ID: 37688458
I need close this question. I appreciate the responses with the links, but I was hoping for someone to provide their own experiences with EF4.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Integration Management Part 2

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question