I'm designing some services and I would like to get some feedback about the conventions I'm using.
For all operations, I always define a 'Context' object and a 'Result' one, because of the following advantages:
- extensibility: I can add parameters to the context or objects to the result without changing the interface
- compactness: I only have a single object in the definition, even if I need many parameters
Example:
[OperationContract]
DoSomethingResult DoSomething(DoSomethingContext context)
Anyway, I'm not really sure that this is the best way to do it because of the following reasons:
- overhead: I always wrap the response properties into an object. Sometimes, the Result object has no properties
- versioning: WCF has built-in versioning for contracts, and maybe it could be better to use a different version to inform about the difference
In fact I use the same technique with normal methods too, so it would be important for me to get some feedback, advices, critics and so on and so forth.
Thank you