Search code examples
javadesign-patternsjax-wsrmi

rmi and webservice


currently i have an web app build with Strus2 and Spring (IoC, Transactions), and i want to split this into 2 apps; one client which will contain only the web part and one core services that will be accessed via webservices and/or rmi.
I have a dilemma in what technology should i use for "glue", because i like the fact that webservices can be accessed by any clients (php,.net,...,mobile), but as i understand java rmi is faster then webservices.
I was thinking to expose the functionality via webservices and rmi in the same time... but i do not know how to do that.
Also in my current app i have a ajax action that is executed each second from the client to the server, and in this new configuration i think that there will be some performance penalties due to this.
How should i "attack" this situation ?
Thanks,


Solution

  • but as i understand java rmi is faster then webservices.

    Why do you think this? Do you have a citation to bolster this claim?

    Both RMI and webservices are using TCP/IP; both incur similar network latency. The former uses Java or CORBA serialization to send messages over the wire; the latter uses either HTTP (for REST) or XML over HTTP (for SOAP or RPC-XML).

    The relative speed is far more dependent on what those services are doing and how you code them.

    I would prefer a web service because simple and open win. You are restricted to RMI/CORBA clients if you use RMI.