views:

137

answers:

1

Application Type: 3-Tier web application with RDBMS at backend

Development Platform

Client : Silverlight 3/ WPF Services: WCF web services with Basic Http binding

Problem Definition: Trying to develop a application that has a client side business handling and data intensive objects being passed to client. Once the objects are viewed and edited in client screen they should be passed to services on server side for save. The issue being since that data is in sizable amount I dont want to pass the entire object back again to the services. E.g:- If I have a collection of 10 rows and 10 columns for each row and only 2 columns are updated. I should be able to pas only the data.

Question: Is this a good practise and if yes whats the best way to achieve

Tried out solutions I have tried two solutions 1: Have setters with event delegate that do change notification 2: Use custom data type

A: 

If you're using WCF web services as automagically generated by VS then you're pretty much constrained to transmitting classes that are known; thus to transmit smaller chunks of info you will need to define some new classes specifically for that purpose. Such objects are I believe commonly called DTO (Data Transfer Objects). So, for your scenario with the 10 x 10 matrix, your DTO would perhaps contain a list of {x, y, value} triples.

If you're using a REST web service (and composing your own) then you might avoid the DTO classes entirely and just create an XML schema that is adequate to convey the info; e.g., a top level element with subelements of the form:

<Deltas>
  <Delta x="3" y="9"> ...value subelementgoes here </Delta>
  ... more Delta elements
</Deltas>

Your REST service would then have to do the work of incrementally updating the server side database records. You'd probably need a distinct REST url for each data type.

HTH

Bill

Bill Cohagan