官术网_书友最值得收藏!

RPC API design

Some of the principles we have just discussed for creating a good RESTful API can also apply to RPC. However; one of the main differences is that you may not be using HTTP as your transport; therefore you are not always going to be able to use HTTP status codes as an indicator of success or failure. RPC stands for Remote Procedure Call and dates way back before the Internet. It was originally conceived as a way to execute a procedure that could be running in a separate application on the same machine or even potentially on the network. While we take this for granted now, back in the 90s this was cutting edge. Unfortunately, frameworks such as CORBA and Java RMI gave RPC a bad name and even now if you speak to an opponent of RPC they will most likely bring these two frameworks up. The benefits, however, were performance, using binary serialization is incredibly efficient on the network and we no longer have the tight coupling that RMI and CORBA enforced. We are also not trying to do anything too clever; we are no longer attempting to share an object across two processes we are taking a more functional approach, that is, methods that return immutable objects. This gives us the best of both worlds; the simplicity of interoperation and the speed and small payload of binary messages.

主站蜘蛛池模板: 左贡县| 岐山县| 突泉县| 涿鹿县| 南充市| 阿瓦提县| 九龙县| 昭苏县| 高尔夫| 开化县| 阿鲁科尔沁旗| 天水市| 禄劝| 九台市| 凌海市| 涿鹿县| 图木舒克市| 普安县| 海阳市| 濉溪县| 靖边县| 万盛区| 和硕县| 永和县| 宜章县| 伊金霍洛旗| 惠安县| 孟州市| 壶关县| 宁明县| 巴林左旗| 苍溪县| 信阳市| 凌源市| 青川县| 突泉县| 麻城市| 新和县| 扶余县| 昌宁县| 赣榆县|