Thanks for taking the time to review my question!
Let’s assume that there is a web service (restful, SOAP, XML/JSON, what ever you want) and it was a service regarding puppies. A puppy, for the purposes of this question, can have two member variables. The first one is a unique ID of the puppy. The other data member is “number of fleas” (Flea Count).
One of the features offered by the puppy service might be “return an object representing a puppy based on the puppy’s ID.”
How would you handle the requirement that a client application can update the Flea Count? Here are some of the ideas I've been floating to myself:
- Do you let the client update the puppy’s Flea Count on the client-side and then send the entire object back to the service so its state can be updated?
- Do you create a method that takes in a puppy ID and a new Flea Count in order to sync the client with the server, but don’t send anything back?
- Do you create a method that takes in a puppy ID and a new Flea Count but have the service respond with the entire updated object that then replaces the existing puppy (oh no!) on the client side?
- Do you create a method that takes in a puppy ID and a new Flea Count, which updates the server, but then the client must call the method associated with returning a puppy object by ID and that replaces the puppy on the client side (perish the thought!)?
- Other?
Thanks.