Luis Felipe.<br /> <br />SCJP, SCWCD.
The Remote Method Invocation (RMI) is a Java system that can be used to easily develop distributed object-based applications. RMI, which makes extensive use of object serialization, can be expressed by the following formula:
RMI = Sockets + Object Serialization + Some Utilities
The utilities are the rmi registry and the compiler to generate stubs and skeletons.
If you are familiar with RMI, you would know that developing distributed object-based applications in RMI is much simpler than using sockets. So why bother with sockets and object serialization then?
The advantages of RMI in comparison with sockets are:
* Simplicity: RMI is much easier to work with than sockets
* No protocol design: unlike sockets, when working with RMI there is no need to worry about designing a protocol between the client and server -- a process that is error-prone.
The simplicity of RMI, however, comes at the expense of the network. There is a communication overhead involved when using RMI and that is due to the RMI registry and client stubs or proxies that make remote invocations transparent. For each RMI remote object there is a need for a proxy, which slows the performance down.
Luis Felipe.<br /> <br />SCJP, SCWCD.
Elliotte Rusty Harold<br />Author of <a href="http://cafe.elharo.com/web/refactoring-html/" target="_blank" rel="nofollow">Refactoring HTML</a>
Luis Felipe.<br /> <br />SCJP, SCWCD.
Originally posted by Elliotte Rusty Harold:
When I was writing the third editon of Java Network Programming, no single chapter was more of a pain than the RMI chapter. I am very much not a fan of RMI. Details depend on what you're doing but in general I would say avoid it at all costs. RMI is broken at a very deep level, and that's become clearer and clearer with each passing year.
I think the community is slowly beginning to realize that there is something fundamentally wrong with the whole idea of technologies like RMI. Something like it is reinvented every four or five years; it's always hyped massively; and it always fails to achieve broad-scale adoption. It failed when it called RPC. It failed when it was called CORBA. It failed when it was called RMI. And it's failing now when it's called SOAP. At some point you have to realize that it's not that each and every one of these technologies designed by very smart, very experienced people was poorly written and poorly implemented. There is a fundamental problem with the whole idea of treating network services as some funky kind of object or function.
Some of the reasons RMI and similar technologies are doomed to fail were identified by Peter Deutsch in the Eight Fallacies of Distributed Computing The correct architecture for many (not all) network services was identified by Tim Berners-Lee, Roy Fielding, and others; and it's called REST. REST is not appropriate for all applications--it doesn't work for telnet, for example--but I question whether RMI/RPC-like architectures are appropriate for any.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Elliotte Rusty Harold<br />Author of <a href="http://cafe.elharo.com/web/refactoring-html/" target="_blank" rel="nofollow">Refactoring HTML</a>
Catalin Merfu<br /><a href="http://www.accendia.com" target="_blank" rel="nofollow">High Performance Java Networking</a>
And then the flying monkeys attacked. My only defense was this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|