Read Only Data Members

How do I specify that the client proxy should not have a setter for a particular data member?

It doesn’t make sense for the service to be able to dictate what the client can do with a piece of data. Once data has been put on the wire, you can’t stop the other side that is receiving the message from doing whatever they want with that data.

Schema and metadata don’t have any notion of access modifiers, but let’s say that they did. You might say in the metadata that a certain piece of data has restricted access. First, there’s nothing requiring me to use the same metadata and tools that you are, so I may not even know about your access modifiers. The representation that gets written to the wire is the truth about how your service works, not the metadata. Second, even if I am using the same metadata and tools as you are, I can always change the client after it’s created because the generated code is something that I own rather than you as the service author.

If the client author and the service author are the same person, then there are much more effective ways of providing a preferred programming model than trying to describe those preferences through some aspect of the service description. Instead, just change the client library directly to do what you want and give people that.

Next time: Certificate Stores

Comments (1)

  1. Orcas introduced a new DateTimeOffset class that is easier to use for representing absolute times than

Skip to main content