Is there a possibility, that implementing a new feature or fixing a bug must require an interface change in the platform?
是的,如果此错误是向后兼容性的意外中断,并且如果您在检测到此中断之前已经发布了产品的多个版本(X 1 … X N).因此,您的一部分客户端依赖于旧版本X,但另一部分客户端依赖于X 1 … X N损坏版本.如果你要修复这个bug,那么新的客户端(X 1 … X N)将被破坏.
Is it a good idea to create a new interface that extends the original one with the new method?
可能,但你可能会遇到这些接口命名和文档编译的问题.我建议您延迟这些功能并每隔3年打破一次API,并提供有关如何更改旧客户端的详细说明.
Of course the invocations in the platform shall now check the type of the listener, if it is the new interface with the new method, then the new method will be invoked, or nothing will be done.
有三种向后兼容性:二进制(运行旧客户端),源(重新编译旧客户端)和行为.如果需要向接口添加新方法,则只能通过检查已使用的接口版本(final String VERSION =“N”)并仅为兼容版本调用new方法来中断源兼容性,但保持二进制兼容性.因此,如果某个旧客户端需要新功能,则应更改并重新编译.