RMI vs. Sockets and Object Serialization
An Introduction to Socket Programming
(Continued from previous question...)
RMI vs. Sockets and Object Serialization
RMI vs. Sockets and Object Serialization
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.
(by)Qusay H. Mahmoud
(Continued on next question...)
Other Interview Questions
|