Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket vs RMI vs Servlets

 
Vidyashri Badiger
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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:

http://java.sun.com/j2se/1.4.2/docs/guide/rmi/spec/rmiTOC.html
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

You may want to have a look at this page also: http://martin.nobilitas.com/java/thruput.html

Hope this helps!

Regards,
Sudha
[ August 30, 2005: Message edited by: Sudha Rams ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic