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

Socket vs RMI vs Servlets

Vidyashri Badiger

Joined: Aug 30, 2005
Posts: 1
What is the difference between socket programming and RMI?
What is the difference between RMI and Servlet programming?

Which is benificial and in what domain?
What are the advantages of each in which domain?
Sudha Rams

Joined: May 13, 2005
Posts: 12

Ahem! You have casually asked a few major questions in one go!

To quickly answer your questions:

RMI is about communication between objects residing in different JVMs where the JVMs can be located in different machines too i.e. it is a distributed environment. You can invoke methods on an object residing in another JVM using RMI. RMI uses socket programming behind the scenes to achieve this i.e. the developer need not worry about the n/w programming details when s/he codes to achieve RMI.

A servlet is a Java class used to extend the capabilities of a server where the server hosts applications and allows them to be accessed using a request-response type of approach. A servlet is mostly used in web applications where the client and the server communicate using the HTTP protocol. The order of communication of the HTTP request will be client -> web server -> web container -> servlet. Every HTTP servlet has a life cycle of its own.

If possible, buy yourself a copy of the Head First series of books.

You can learn more using these links:

You may want to have a look at this page also:

Hope this helps!

[ August 30, 2005: Message edited by: Sudha Rams ]
I agree. Here's the link:
subject: Socket vs RMI vs Servlets
It's not a secret anymore!