What are the benefits of using RMI over TCP/IP? I mean, if I want to merely pass some data to a server(it is not a web application) and get the response back, should I go for RMI with remote calls? Or it is more efficient to stick to TCP/IP sockets? Please advice.
RMI provides a standardized, "object"-ized way to communicate over TCP/IP. It is (mostly) only for Java, though. So - if you need 2 or more Java programs to communicate, it's probably better to choose RMI (or a technology built on RMI that is appropriate to the needs of your project - such as EJB, Jini, etc.) - if you're going to be communicating with non-Java programs you'd need something else - straight TCP/IP socket communication, CORBA, or Web Services.
RMI makes it a lot easier to expand or change the network communication layer of your program - there may be slightly better efficiency using TCP/IP, since there are fewer objects (at least it sounds like the starting implementation would have fewer), but it's a lot easier to modify things when they need changed later.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Author and all-around good cowpoke
Joined: Mar 22, 2000
More efficient - in terms of what? development time? bandwidth? memory usage? security? interoperation? Bill