API design ensuring backward compatibility [closed]

会有一股神秘感。 提交于 2019-12-03 12:40:54

问题


Are there any best practices to keep in mind while designing API's which ensures backward compatibility and new version releases. Any links to articles/blogs is appreciated.


回答1:


You should check out this presentation about API design. It's from Google and pretty good. It also addresses backward compatibility and new releases.

How to Design a Good API and Why it Matters




回答2:


keep both running, with version in the url. api.mysite.com/[version]/api/url/here. Notify the users when a new version of the API arrives, and drop the old version after a while. Either when it isn't used anymore, or like 6 months insuring the users had enough time to change it.

Or keep it running forever, but don't deliver any new functionality for it.




回答3:


The best way to do this to keep the old interface or class in new release with new interface and classes and marked them as deprecated (means those will be removed in future release).

Hear API designer keep in mind about difference between public interface and published interface.



来源:https://stackoverflow.com/questions/8907512/api-design-ensuring-backward-compatibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!