How to transfer composit data type? RRS feed

  • Question

  • Hi,

    I'm working on tree tier architecture project using wcf service , as you know we have some contract data class for communication between service and client.

    the problem is here : What should I do about some composition data , for example reports data

    the first solution is to make a custom contract class for my reports

    the second solution is to transfer this type of data by dataset

    Which solution do you suggest?( If there is some other solution please let me know).

    thanks a lot


    Sunday, January 30, 2011 5:31 PM

All replies

  • Hi Hamid,

    data sets will probably give you a lot of headaches. They can grow big in size and you'll most certainly experience serialization issues. Therefore, they include communication overhead. Another thing you must think about is decoupling your service layer from your DAL layer. DTOs (data transfer objects) are in my opinion a much cleaner way of handling things + you get all the previously mentioned benefits.


    Stipe Ivan

    Friday, February 11, 2011 8:52 PM
  • Keep your data that is transmitting across the wire in DataContracts. the DataContracts should be as lean as possible to avoid overhead of Data Transfers. DTOs are a good strategy too, but don't try to send ADO.Net objects across the wire. You might now face serialization issues, but these objects have a VERY BIG FOOTPRINT and you might not need all the data they contain.


    This has been discussed in this thread too :  http://social.msdn.microsoft.com/Forums/en-US/architecturegeneral/thread/893d711b-c074-42f5-bb2c-c20f524a11cf/#c35ac0a3-80ca-4bd4-8382-d044472df8f5

    Friday, February 11, 2011 9:28 PM