We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Entity Framework 4 vs Dataset

Medium Priority
621 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
Comment
Watch Question

hes
CERTIFIED EXPERT

Commented:
Imran Javed ZiaConsultant Software Engineer - .NET Architect
CERTIFIED EXPERT

Commented:

Author

Commented:
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.
(?)

Author

Commented:
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.

Commented:
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.
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
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.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.