Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is difference between rest web services vs ejb session beans? [closed]

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.

like image 450
dsk Avatar asked Mar 13 '23 16:03

dsk


1 Answers

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.

like image 58
Teddy Avatar answered Apr 27 '23 17:04

Teddy