views:

156

answers:

3

I am currently calling a web service that returns a service defined class which I am interpreting in my application. I'm considering asking the vendor of this web service to add a property to this class which will make my life as well as their other clients lives a lot easier. To be clear I'm not asking them to modify existing behaviour or properties, so this would extend existing functionality.

My question is, if they add this property to the class, will it adversely affect existing clients' applications?

+2  A: 

Yes, it could mean you get serialization errors if you haven't updated your proxies. Its better to version the service interface even if that means supporting multiple versions at once.

Jeremy
Given this vendor's past behaviour, I can foresee them not wanting to do this because of future maintenance overheads.
BenAlabaster
Theoretically - shouldn't the serialization in the existing clients proxies just ignore the additional properties?
BenAlabaster
It can work, but I wouldn't take the chance of it if I've got mulitple clients using the interface - how do I ensure they all test properly etc.
Jeremy
All points I'd considered, hence my question...
BenAlabaster
So if your question is, does .NET guarantee serialization will work if new properties are added the answer is no. Also keep in mind this is a client issue - they may not even be using .NET in their clients.
Jeremy
That's a fair point too, I hadn't considered that.
BenAlabaster
People don't use .NET? ... what ?!?! ... fools ;-)
John MacIntyre
+1  A: 

Aside from the fact that you are asking a third party to shoulder the development, (which they are often not excited to do). The modifying/extending of the web service could require downtime, which may matter a great deal. It also would interfere with the backwards compatibility of their API.

There is also a performance consideration if the property contains a lot of additional data which will be propagated to all clients unnecessarily.

Yes, I'd considered this already. The property I'm asking them to add is really an extension of an existing property that provides a timestamp of when the existing property was last changed - not much data at all. Downtime hasn't been an issue for them in the past, I've often had issues with that.
BenAlabaster
+3  A: 

It can potentially be a problem, yes:

  • the old client may barf when receiving the unexpected property from the server
  • the server may barf when not receiving the expected property from old clients

It can also work... it just needs testing / planning.

A safer option (if you have complex deployment that can't all go at once) is to consider the API sealed and add a new "v2" end-point etc.

Marc Gravell
I guess the server side depends on how they wrote the serializer. In the client proxy though, would it not just ignore the additional fields? I don't know enough about the .NET web service proxy to determine this.
BenAlabaster
Re the client proxy: With a web-service, it is hard to be sure who or what the client is...
Marc Gravell