I have not used EJB before but read about it. So I am a bit confused about the REST services and EJB stateless and stateful session beans.
So what are the differences between stateless session beans and REST service? And with stateful.
Web services are a system integration technology. If you had some data and/or logic which you wanted to make available to other applications within your company, or to external applications, you would use web services. There are different types of Web services approaches and REST web services are one of the popular types of web services.
So, web services are just a 'presentation' layer. You could already have an existing application which you could expose to other applications for interaction by creating a Web service layer.
The data access and business logic which do the real work behind the web services layer could be written in plain Java or they could use different frameworks which can help with various tasks.
If you wanted your business logic to support transactions, access control, distribution across servers for load balancing, clustering to share state across servers, etc., you could use frameworks to help you with these complex tasks.
EJB is one approach to writing business logic which involves conforming to some standard interfaces, so that you could then declaratively add support services like transaction management, authentication and authorization, load balancing, clustering etc. with relatively less effort.
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