Java RMI 有什么意义?

What is the point of Java RMI?

为什么 Java RMI 存在?谁在使用它?为了什么?

我最紧迫的问题;

Why does Java RMI exist?

错误,因为 Sun built it? The same Sun that provided Sun RPC.

Who uses it and for what?

RMI is the basis of Jakarta EE (formerly J2EE) just to name one small example. However the concept of remote method calls dates further back to at least CORBA, and the concept of remote procedure calls to at least the 1970s. Sun provided their implementation of RPC in about 1982 and it is the basis of NFS 等等。

Why would you want to make calls to methods that aren't defined on your machine?

呃,如果你想让他们 运行 在另一台机器上?

Wouldn't it take much longer to execute?

当然可以。

I don't see how this makes the world a better place. Wouldn't it just be smarter to have many machines running the complete program rather than many machines each running parts?

所以你从未听说过 distributed computing,那么?

Doesn't the fact that you have to manually provide interfaces to all the machines (clients and servers) kill whatever benefits having remote objects provides?

没有

In other words, if a benefit of having a remote object is that the client programmer doesn't have to interact with the server programmer

有人说这是好处吗?

then doesn't it get annoying to have manually contact each other to update the interfaces on both sides for each little change?

如果您在实施之前实际设计您的系统,那么往往不会有很多 'little changes'。但这无论如何不是唯一的开发模型。您可以让第三方开发界面。或者同一个人发展双方。或者具有由规范定义的远程接口。或者...

How is this similar or different to a typical web app set up where a client communicates with a server?

它使用 RMI 而不是 HTTP

In my mind, HTTP calls are much easier to understand.

没有比远程界面更容易理解的了,但显然你的里程会有所不同。

Can an RMI Server require some sort of password from RMI clients?

是的,它可以使用相互认证的 TLS,或者通过自定义套接字工厂实现的任意认证协议。