RMI vs. Sockets and Object Serialization
by, 04-25-2012 at 11:15 PM (1948 Views)
RMI or Remote Method Invocation is that Java system which is used to create the applications which are distributed object based. Given formula could be used to express the RMI that uses object serialization extensively.
Remote method invocation = Sockets + Object Serialization + Some Utilities
Compiler & RMI registry are utilities to generate the skeletons & stubs.
If you are aware of RMI then you would definitely know that it is a very simple task to create the distributed object based application as compared to socket usage. Hence, there is no need to be bothered with object serialization & sockets.
As compared to sockets, RMI’s advantages are given below:
• Simplicity: One could easily work with RMI as compared to sockets.
• No protocol design: In case of RMI one don’t need to worry about protocol designing b/w server & client.
At network’s expense comes the RMI’s simplicity. Communication overhead is involved while using RMI. This is because of the client stubs, RMI registry or the proxies which makes those invocations transparent which are remote. All RMI remote objects, proxy is need that ultimately slows down the performance.