What to choose with n-tier application in .NET typed datasets or something else?
So I'm doing a project. MS SQL->WCF->Client (win32 application + asp.net MVC 3 web) I have worker with ado.net typed datasets till now, but now I have question... What's your opinion what should I use for WCF->Clie开发者_如何学运维nt Typed Datasets or something else? Performance (speed) is preety important also.... Thanks in advance
Strongly typed entities is the way to go. Dataset generally must be avoided for performance reasons.
ORMs such as NHibernate or Entity Fframework 4 must be used for turning database state to and from entities.
I have done the mistake to confuse typed datasets with business entities in the past and would not fall this way again ever. They are handy and easy to design and use but a typed dataset is not a business entity.
I think the best way is to use classes and interfaces properly combined so you could have a general approach and specialize with derived classes as needed, in WCF there is the concept of DataContract which is very useful as well.
WCF per se does not support DataSets. Use serializable DTO´s instead.
精彩评论