I've got a service that exposes a method to update some values in a record. Rather than several individual methods (setX, setY, setFoo, etc.), I'm using a single method that allows the caller to update all possible fields in one action (reduces network traffic). I would like to allow the caller to control which parameters are acted upon though, and am wondering if anyone has any recommendations in this regard.
For example, consider a method definition something like this: UpdateRecord(long ID, String name, int age, String address); I'd like the user to be able to selectively request updating only the name or only the age or perhaps just the age and the address, etc. And remember, I want to minimize traffic, so implementing setName(), setAge(), setAddress() is not acceptable. My current plan is to pass -1 for the numeric values I don't want updated, and an empty string for the "String" parameters I don't want updated. I'm fine with the numeric case, but for the Strings, it would be nicer to pass null. Is this possible? I suppose the other thing I could do is pass some sort of flag(s) indicating which parameters are to be acted upon. Any comments? -Roy "Disclaimer The opinions expressed in this message are strictly personal and do not necessarily reflect those of FiLogix."