RPC和RMI的區別(Difference Between RPC and RMI)

來源:互聯網
上載者:User

標籤:

RPC和RMI的區別(Difference Between RPC and RMI)

RPC vs RMI

  RPC (Remote Procedure Call) and RMI (Remote Method Invocation) are two mechanisms that allow the user to invoke or call processes that will run on a different computer from the one the user is using. The main difference between the two is the approach or paradigm used. RMI uses an object oriented paradigm where the user needs to know the object and the method of the object he needs to invoke. In comparison, RPC isn’t object oriented and doesn’t deal with objects. Rather, it calls specific subroutines that are already established.

  RPC(遠端程序呼叫)和RMI(遠程方法調用)是兩種可以讓使用者從一台電腦調用不同電腦上面的方法的的機制(也可以稱作規範、協議)。兩者的主要不同是他們的使用方式或者稱作範式,RMI使用物件導向的範式,也就是使用者需要知道他調用的對象和對象中的方法;RPC不是物件導向也不能處理對象,而是調用具體的子程式。

  RPC is a relatively old protocol that is based on the C language, thus inheriting its paradigm. With RPC, you get a procedure call that looks pretty much like a local call. RPC handles the complexities involved with passing the call from the local to the remote computer. RMI does the very same thing; handling the complexities of passing along the invocation from the local to the remote computer. But instead of passing a procedural call, RMI passes a reference to the object and the method that is being called. RMI was developed by Java and uses its virtual machine. Its use is therefore exclusive to Java applications for calling methods on remote computers.

  RPC是一個基於C語言的相對較舊的協議,因此也就繼承了C語言的範式,使用RPC,你可以像調用一個本地方法一樣調用遠端方法,由RPC處理調用過程的複雜操作,RMI的功能和RPC基本一樣。但是和RPC只傳輸一個程序呼叫不同,RMI需要傳輸對象的引用以及調用的方法。RMI是用Java開發的,運行在Java虛擬機器上,因此它的用途是調用遠端電腦上的java應用程式。

  In the end, RPC and RMI are just two means of achieving the same exact thing. It all comes down to what language you are using and which paradigm you are used to. Using the object oriented RMI is the better approach between the two, especially with larger programs as it provides a cleaner code that is easier to track down once something goes wrong. Use of RPC is still widely accepted, especially when any of the alternative remote procedural protocols are not an option.

  最後,RPC和RMI只是處理同一個問題的不同方式,這一切都歸結於你所使用的語言和你所使用的範式。使用物件導向的RMI是兩者之間的更好的方法,特別是大型程式,使用RMI代碼更簡潔,更容易追蹤bug。RPC目前依然是被廣泛接受的,尤其是當無法選擇任何的可替代的遠程程式協議時候。

Summary:

1.RMI is object oriented while RPC isn’t2.RPC is C bases while RMI is Java only3.RMI invokes methods while RPC invokes functions4.RPC is antiquated while RMI is the future

總結:

1、RMI是物件導向的,而RPC不是

2、RPC是基於C語言的,而RMI是僅僅基於Java的

3、RMI調用方法,而RPC調用函數

4、RPC是過時的,而RMI是未來

原文地址: Difference Between RPC and RMI | Difference Between | RPC vs RMI http://www.differencebetween.net/technology/protocols-formats/difference-between-rpc-and-rmi/#ixzz47OPXuhEv

部落格

RPC和RMI的區別(Difference Between RPC and RMI)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.