Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RMI vs REST Service

Tags:

java

rest

rmi

We are developing a service for our portal / web client developed using JSF . My advice was to expose the service as REST but another team member said to go with RMI implementation since its easier to deal in java object from development and testing point of view.

My argument was development and testing efforts with be pretty much the same but we will get all the goodness of REST web services.

FYI : We already have REST setup so there is no extra cost in framework support. This services are exposed for our smartphone client who uses REST api.

At the end our Manager decided to go with RMI way but I still think REST would be smarter way.

What would be your choice REST or RMI?

Note : Nothing against my team member or Manager just trying to learn here.

like image 892
Farm Avatar asked Jul 15 '11 03:07

Farm


People also ask

Does ReST use RMI?

ReST is an HTTP protocol, so it requires a webapp server. ReST doesn't run over RMI.

What is the difference between RMI and Web services?

In general, RMI's performance exceeds web services, if the communication requirement is for complex objects. The JEE interface specification needs to be explicitly specified for Web Services. Note that Web Services are interoperable whereas RMI is not (in terms of the technologies of Client and Server).

Is RMI outdated?

No, RMI is not deprecated. Not only is it not deprecated, it is a foundation building block for every J2EE application on the planet.

What is an RMI service?

Remote Method Invocation (RMI) is the standard for distributed object computing in Java. RMI enables an application to obtain a reference to an object that exists elsewhere in the network, and then invoke methods on that object as though it existed locally in the client's virtual machine.


2 Answers

If there are firewalls between your client and server, it is likely that RMI traffic might be blocked. HTTP traffic is open on most firewalls and REST should have no problem getting through.

like image 175
shark8me Avatar answered Sep 28 '22 04:09

shark8me


The biggest argument against RMI and for REST/SOAP etc is that the client does not have to be Java.

If your front-end could change down the road from JSF to ASP, then you'll be in some trouble.

Other than that, RMI is the way to go. An even better way to go is EJB ( which is a layer on top of RMI ) with additional advantages -- lots of vendors already implement the EJB spec, you get the advantages of object pooling, transaction management etc.

like image 24
Kal Avatar answered Sep 28 '22 05:09

Kal