When developing distributed applications, all written in Java by the same company, would you choose Web Services or RMI? What are the pros and cons in terms of performance, loose coupling, ease of use, ...? Would anyone choose WS? Can you build a service-oriented architecture with RMI?
The Java Remote Method Invocation (RMI) system allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine. RMI provides for remote communication between programs written in the Java programming language.
RMI is still useful, but its application is limited and generally best used in-house. One place RMI found a home was in RMI-IIOP, which became the basis of the RMI mechanism of Enterprise JavaBeans Remote Interface. However, remote EJBs are likewise not very common anymore.
RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM. RMI is used to build distributed applications; it provides remote communication between Java programs.
I'd try to think about it this way:
Are you going for independent services running beneath each other, and those services may be accessed by non-java applications some time in the future? Then go for web services.
Do you just want to spread parts of an application (mind the singular) over several servers? Then go for RMI and you won't have to leave the Java universe to get everything working together tightly coupled.
I would choose WS.
And... I would most likely choose REST services.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With