Last post Jan 01, 2015 02:59 PM by Siva Krishna Macha
Jan 01, 2015 09:46 AM|francissvk|LINK
My question is: What is the pros/cons of these mechanisms 1 and 2 and which one is best?
Jan 01, 2015 02:39 PM|AidyF|LINK
The only "pro" to using a dataset is also a "con", in that the data and data structure can be anything. This might seem good as it is flexible, but it means the calling code has no way of knowing what data to expect, and such solutions with loose data definitions
are prone to errors when things might change.
Creating your own classes and passing them as lists or arrays mean that both sides of the service know exactly what the data structure that is being sent is like, and it means your calling code knows exactly properties the data has, their types etc. It
will also mean less data being sent over the network.
Jan 01, 2015 02:59 PM|Siva Krishna Macha|LINK
#2 is best compared to #1 in my opinion.
DataSet or DataTable are specific to .net technology and as you know Webservices or WCF services are evolved to cater non-dotnet technologies as well.
Defining classes instead of DataSet or DataTable would make easier for the clients to understand and program on the object model easier.