Search code examples
javaweb-servicesremotingrmi

What are the pros and cons of Web Services and RMI in a Java-only environment?


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?


Solution

  • 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.