开发者

Do we really need to create Stub in java RMI?

开发者 https://www.devze.com 2023-02-22 09:45 出处:网络
I am reading some RMI document and all the books say that开发者_如何学Go we need to create Stub for the client in order to communicate with the server.

I am reading some RMI document and all the books say that开发者_如何学Go we need to create Stub for the client in order to communicate with the server. However, I have tried to not create stub and things worked like a charm. I have put the client program on one machine and the server on another, things worked perfectly. So, what is actually the purpose of creating Stub and do we really need to create one? Thanks.


Since Java 1.5 you don't have to:

This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use [...] stub compiler, rmic, to pregenerate stub classes for remote objects. Note that rmic must still be used to pregenerate stub classes for remote objects that need to support clients running on earlier versions.

From http://download.oracle.com/javase/1.5.0/docs/guide/rmi/relnotes.html

0

精彩评论

暂无评论...
验证码 换一张
取 消