1 of 1 people found this helpful
Hello, in my opinion the EJBs have a few more advantages over REST inside a server environment:
- easier "server" side configuration, no need to annotate every method
- easier usage on the "client" side - you're just injecting a bean and using it just as it was in the same jvm, no need to use a rest api to call every method (unless you're using sth as resteasy's proxy)
- ejbs can be distributed out of the box. If you have redundant REST endpoints you have to handle it yourself e.g. with an apache or in your code
- with REST there are "always" problems with configuration of the mapping of the domain objects to/from json ; with ejbs there's simple serialization
I even start thinking that for a desktop java client the ejb-client would be better than rest access that we currently use (because of high availability and proxy).
And what solution in your environment have you chosen since the original post?
Hi kRyszard Zklanu ,
the question is a bit old. But still thank you very much for the answer.
And actually I did not have any influence on that project and decisions. As I think there are two main strategies, both of which are legal:
- clustering - and then off course you use EJB and all goodies of J2EE like caches etc.
- farming/microservices - in this case you have to rely on web services. Having overhead in different infrastructural issues and integration you gain flexibility.
IMHO the decision one or another have to be made pretty early. But again IMHO in huge software development projects/companies very important to implement governance, service architecture. In other case you will have a mess.