Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

RMI vs. Sockets vs. ?

Thread view: 
KDawg44 - 18 Jun 2007 00:27 GMT
Hi,

In my graduate class we have to implement a distributed application
using Sockets and then again using Remote Method Invocation (RMI).  Is
one more prevalent than the other in the "real world"?  Or is there
something else that is used?

Just curious for my own knowledge and satisfaciton.

Thanks.
Manish Pandit - 18 Jun 2007 06:30 GMT
> Hi,
>
[quoted text clipped - 6 lines]
>
> Thanks.

It depends on the situation. If you need performance (like streaming),
go with sockets. With sockets, you will have to pretty much do the
ground work (like create connection, write on a socket, create your
own handshake of not using standard services, etc.) as well.

If you want a more standards based approach, go with RMI. In the real
world, I've seen the focus shift more towards SOAP/REST webservices or
XML/RPC rather than plain old RMI. If transport is not an issue
(always HTTP), REST based webservices are more common.

-cheers,
Manish
Sundar - 18 Jun 2007 12:46 GMT
> Hi,
>
[quoted text clipped - 6 lines]
>
> Thanks.

As far as I know only sockets and RMI are available for distributed
programming. RMI is easier than socket programming, but socket
programming gives more control.

-Sundar
jawadhashmi@gmail.com - 18 Jun 2007 13:32 GMT
> As far as I know only sockets and RMI are available for distributed
> programming. RMI is easier than socket programming, but socket
> programming gives more control.

RMI will provides the opertunity to talk with another Java
application. But sockets can help to connect with application written
in any language and listening on the specific port.
Soap is another option to do just like RMI. And is cross platform like
sockets.

SOAP is slower then plain sockets.
Lew - 18 Jun 2007 15:13 GMT
>> As far as I know only sockets and RMI are available for distributed
>> programming. RMI is easier than socket programming, but socket
>> programming gives more control.

> RMI will provides the opertunity to talk with another Java
> application. But sockets can help to connect with application written
[quoted text clipped - 3 lines]
>
> SOAP is slower then plain sockets.

"Plain" sockets still require a formatted message of /some/ type to be of any
use.  Neglecting for a microsecond the labor cost of creating the apps, by the
time you compare the parsing, error-handling and related tasks for a custom
message infrastructure against a SOAP-based one with, say Apache and Sun
tools, you may find that message sizes are not quite so different, and
processing costs closer still.  Nevertheless, typical custom message formats
do tend to be more compact than SOAP-based standard ones, albeit at a cost of
complexity and fragility, not to say inflexibility.  Plu

Arguably the real cost of a system is human time, both to develop an
application and to use it effectively in production.  Use of standards
libraries naturally reduce the development cost.  A key factor of SOAP-based
infrastructures is the division of labor between the architect, who devises
the distributed API and concomitant WSDLs, and the app developer (possibly the
same person wearing a different hat), who creates implementations of the API
virtually automatically with standard tools.  I've seen in practice how widely
disparate programming shops, comprising both .Net and J2EE cultures, could
develop web-service clients extremely quickly from the WSDL, much faster than
I have seen with any kind of custom infrastructure.

In maintenance and production the text format of XML messages makes
troubleshooting ridiculously easier than with binary formats.  If the
architect did their job right, the tags tell a story that helps the
maintainer.  WSDL is an example of "literate programming" - it encodes all
kinds of documentary information about the interfaces in human-readable form
that is present in the runtime messages.

The next question is how you measure "slower".  Undoubtedly SOAP messages
would require more bytes than "equivalent" custom-format compact messages; I'd
be dubious of claims that there are significant differences in "speed" once a
message reaches its destination.  However, the SOAP message contains much more
information than more compact representations.  If you measure some unit of
information (noons?) you might find that SOAP messages transmit more
information per unit time than other formats.

The real-world decision of what to use would consider arbitrary, tangential
measures of message "speed" far, far down the list, particularly absent
evidence of significant performance impact.

Signature

Lew

Roedy Green - 29 Jun 2007 16:42 GMT
>.  Undoubtedly SOAP messages
>would require more bytes than "equivalent" custom-format compact messages; I'd
>be dubious of claims that there are significant differences in "speed" once a
>message reaches its destinatio

The most likely bottleneck in serious response time problems in a
client server apps is going to be the transmission time.  SOAP is like
some 1000 pound babe at the circus guzzling twinkies when it comes to
transmission time.  She does not just eat transmission time, she
glorifies in the gluttony of wallowing in it.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Roedy Green - 29 Jun 2007 16:39 GMT
>In my graduate class we have to implement a distributed application
>using Sockets and then again using Remote Method Invocation (RMI).  Is
>one more prevalent than the other in the "real world"?  Or is there
>something else that is used?
all kinds of things are used. See
http://mindprod.com/jgloss/remotefileaccess.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Arne Vajhøj - 04 Jul 2007 04:48 GMT
> In my graduate class we have to implement a distributed application
> using Sockets and then again using Remote Method Invocation (RMI).  Is
> one more prevalent than the other in the "real world"?  Or is there
> something else that is used?

Both are widely used.

RMI is ideal for call API interaction with many
arguments of different complex types that are still
reasonable small in size.

Sockets are ideal for transferring simple structured
but very large data (like file upload/download).

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.