RMI vs REST Service

前端 未结 3 769
情深已故
情深已故 2021-02-07 14:34

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 implementat

相关标签:
3条回答
  • 2021-02-07 14:46

    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.

    0 讨论(0)
  • 2021-02-07 15:07

    Is the client in Java, use RMI. But that is to simple thought. As it is only a point to point protocol.

    REST as a paradigm is interesting if you have e.g. many reads and like to use HTTP technologies for caching etc. The next thing is you likely can easy implement "paging cursors" so you send data as a small page and add info how to retrieve the next page.

    Your question basically is formulated as if it is a technology question. Which is the wrong approach. You should not bother about technology but about system architecture. The whole software system, its abilities, its performance, its scaling, its configuration and its maintenance is completely different depending on your usage of RMI or REST.

    0 讨论(0)
  • 2021-02-07 15:09

    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.

    0 讨论(0)
提交回复
热议问题