Choosing between RMI and Socket programming

Hi Guys,

We have a product that need to be integrated with another product written in C++.The thing is both are running on different machines. we are planning to use RMI or Socket programs to make remote calls....

Can somebody suggest us some pros and cons on the security and performance issues associated with bothand which one we can choose between them.

Message was edited by:

rahul_yadav

[424 byte] By [rahul_yadava] at [2007-11-27 5:22:21]
# 1
There are no security or performance issues to be considered as between these two choices, because RMI only works between Java and Java.Your only choices are: Sockets; RMI/IIOP if your C++ environment includes an ORB; JMS if your C++ environment includes a message broker; SOAP; ...
ejpa at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...
# 2
But ..it will have an open port of RMI registry ...will it not create an security threat?also the remote calls may be expense with RMI then with Socket programming?
rahul_yadava at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...
# 3
What do you mean, 'but'?How are you going to have an open RMI port, or a security or performance problem of any description, when you can't use RMI at all between Java and C++?Please read more carefully.
ejpa at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...
# 4
i have RMI client calling remote objects on RMI server which is in turn calling c++ dll.
rahul_yadava at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...
# 5
RMI had security already built in. If you go with sockets, you will have to handle all the security for yourself.Either way its good to understand what you are doing. its just taht if you do sockets, you will be replicating work already done and tested with RMI.
_dnoyeBa at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...
# 6

if you go with RMI on the C++ side, security is the least of your problems, you will have to handle all the byte-ordering, protocol, unmarshalling, research and/or reverse-engineering yourself

you will not be replicating any work that has already been done -- none of it has been done (commercially) in C++

as ejp said, RMI is a Java-only technology

developer_jbsa at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...
# 7
He answered that issue in reply #4 where he clarified that he does indeed have Java at both ends.As regards security, _dnoybe is right, RMI already has a security model. It is plain Sockets that don't. There are open TCP ports in either scenario: that's not a differentiator.
ejpa at 2007-7-12 11:47:43 > top of Java-index,Core,Core APIs...