File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: RMI vs. Serialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: RMI vs. Serialization" Watch "NX: RMI vs. Serialization" New topic

NX: RMI vs. Serialization

ulvi ugur
Ranch Hand

Joined: Aug 05, 2003
Posts: 46
Hi All,
I want to look at the assignment from RMI and serialization point of view. The Advanced Features of Java book from Sun says stg. like "Dont use RMI unless you see a significent benefit". So, the main adv. of RMI is clear that [BOLD]one doesn't need to encode/decode the request/response[/BOLD]; and the main disadvantage is [BOLD]being inefficient for transferring large amounts of data.[/BOLD].
I would like to hear about your insights about these two alternatives.
Cheers, Ulvi
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11777

Hi Ulvi
Don't forget that RMI also hides the detail of networking from you. Because it appears that you are just calling a normal method on a normal class, it can be easier for that junior programmer to understand.
Using sockets will generally use fewer resources all round, not just bandwidth and numbers of messages sent, but also fewer processes on the server, and fewer maintenance threads running.
The disadvantages for RMI are not a big concern in this case - we are only shipping very small messages around, and we are not expecting to have thousands of users.
Have I totally failed to give you a clear idea of which one to use? Good
Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I agree. Here's the link:
subject: NX: RMI vs. Serialization
It's not a secret anymore!