我可以在不影响现有客户端的情况下修改/扩展生产Web服务吗?

时间:2021-12-08 13:58:59

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.

我目前正在调用一个Web服务,它返回一个服务定义的类,我在我的应用程序中解释。我正在考虑要求这个Web服务的供应商在这个类中添加一个属性,这将使我和其他客户的生活更加轻松。要明确我不是要求他们修改现有的行为或属性,所以这会扩展现有的功能。

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

我的问题是,如果他们将此属性添加到类中,它是否会对现有客户端的应用程序产生负面影响?

3 个解决方案

#1


It can potentially be a problem, yes:

它可能是一个问题,是的:

  • the old client may barf when receiving the unexpected property from the server
  • 从服务器接收意外属性时,旧客户端可能会进行barf

  • the server may barf when not receiving the expected property from old clients
  • 当没有从旧客户端接收预期的属性时,服务器可能会barf

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.

更安全的选择(如果您的复杂部署不能同时进行)是考虑API密封并添加新的“v2”端点等。

#2


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.

是的,如果您尚未更新代理,则可能意味着您会收到序列化错误。它更好地版本化服务接口,即使这意味着同时支持多个版本。

#3


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.

除了你要求第三方承担开发的事实之外(他们通常不会兴奋)。修改/扩展Web服务可能需要停机,这可能很重要。它还会干扰其API的向后兼容性。

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

如果属性包含许多其他数据,这些数据将不必要地传播到所有客户端,那么还有性能考虑因素。

#1


It can potentially be a problem, yes:

它可能是一个问题,是的:

  • the old client may barf when receiving the unexpected property from the server
  • 从服务器接收意外属性时,旧客户端可能会进行barf

  • the server may barf when not receiving the expected property from old clients
  • 当没有从旧客户端接收预期的属性时,服务器可能会barf

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.

更安全的选择(如果您的复杂部署不能同时进行)是考虑API密封并添加新的“v2”端点等。

#2


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.

是的,如果您尚未更新代理,则可能意味着您会收到序列化错误。它更好地版本化服务接口,即使这意味着同时支持多个版本。

#3


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.

除了你要求第三方承担开发的事实之外(他们通常不会兴奋)。修改/扩展Web服务可能需要停机,这可能很重要。它还会干扰其API的向后兼容性。

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

如果属性包含许多其他数据,这些数据将不必要地传播到所有客户端,那么还有性能考虑因素。