Link to home
Start Free TrialLog in
Avatar of Bill732
Bill732

asked on

Entity Framework 4 vs Dataset

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
Avatar of hes
hes
Flag of United States of America image

Avatar of Bill732
Bill732

ASKER

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.
(?)
Avatar of Bill732

ASKER

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.
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.
ASKER CERTIFIED SOLUTION
Avatar of Bill732
Bill732

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bill732

ASKER

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.