Thrift兼容性, 有哪些最佳时间?

2016/12/7

问题

搜索「Thrift 最佳实践」 「thrift best practices」
答案挺多, 众说纷纭

其中一条(https://github.com/bkayser/th... )
有这样一段文字

Whenever the IDL for a service is modified, new service stubs are generated. Depending on the change, the new version may be backward binary compatible or incompatible with clients trying to connect with older versions of the stubs.

Backward Compatible Changes -- Good!

Adding new methods or structs
Adding a non-required field to a struct
Changing a method return type from void to anything else
Removing an exception from a method signature
Removing a field from a struct
Renaming a struct
Adding an argument to a method with or without a default value
Removing an argument from a method
Changing the order of arguments in a method
Changing the namespace


These changes will still allow older clients to connect to the new version of the server.

这些真的是最佳实践吗? (见下面, 不敢太苟同)

Adding new methods or structs
Adding a non-required field to a struct
Changing a method return type from void to anything else
Removing an exception from a method signature
Removing a field from a struct
Renaming a struct
Adding an argument to a method with or without a default value
Removing an argument from a method
Changing the order of arguments in a method
Changing the namespace
阅读 3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进