Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ejb-dev] Why EJB ?

If you use tomcat ( without EJBs) instead of tomee ( with EJBs)  then you cannot implement  "
transaction handling, pooling, thread synchronization"  ?




zahid



https://www.backbutton.org

¯\_(ツ)_/¯
♡۶♡۶ ♡۶
   

On Thu, 23 Sep 2021, 16:26 Ondrej Mihályi, <ondrej.mihalyi@xxxxxxxxxxx> wrote:
Hi, Zahid,

My first impression is that you have a very old book. The version of JSP mentioned in your link is very old, 1.0, while the latest version of JSP is 2.3. The version 1.0 was released in 2002. While JSP is still often used because it's a standard technology and still has some performance benefits, I'd say nowadays it's better to start with a more modern technology like Jakarta Server Faces (JSF) or a _javascript_-based framework like Angular or React combined with REST services written using Jakarta REST (JAX-RS).

EJBs are quite an old technology, however, it still provides important functionality that is not provided by any other Jakarta EE specification. Most notable are transaction handling, pooling, thread synchronization. But I think you're confusin EJBs with "beans", which may be just a plain Java object used by some technology.

Instead of JSP + bean + database suggested by your book, I'd start with the following:

JSF + CDI (dependency injection) + JTA (transactions) + JPA (database access) + database

Or, you can also use Stateless EJBs instead of CDI + JTA, because EJBs also provide dependency injection and transactions out of the box.

I would also have a look at the Cargo Tracker project, which describes how to apply design patterns in building an enterprise application using Jakarta EE with an example application that uses these patterns: https://eclipse-ee4j.github.io/cargotracker/


Kind regards,

Ondrej Mihályi

Senior Payara Service Engineer
Payara - Supported Enterprise Software for Jakarta EE and MicroProfile Applications
US: +1 415 523 0175 | UK: +44 207 754 0481

----------------------------------------------------------------------------------------------------------------------

Payara is a proud recipient of the prestigious Queen's Award for Enterprise: International Trade 2021

Payara-Tech LDA, Registered Office: Rua Nova de São Pedro no. 54, 2nd floor, room “D”, 9000 048 Funchal, Ilha da Madeira, Portugal

VAT: PT 515158674 | www.payara.fish | info@xxxxxxxxxxx | @Payara_Fish


From: ejb-dev <ejb-dev-bounces@xxxxxxxxxxx> on behalf of Zahid Rahman <zahidr1000@xxxxxxxxx>
Sent: 17 September 2021 05:25
To: ejb-dev@xxxxxxxxxxx <ejb-dev@xxxxxxxxxxx>
Subject: [ejb-dev] Why EJB ?
 

Hi,

I was reading a book  giving advice on which components to use to build e-commerce web applications.

The book advised to use JSP   + bean   +  database .

They also gave reasons for using the components as detailed at this link. 


Can you give a reason why ejbs should be  also be included in the e-commerce application build  ?

zahid



https://www.backbutton.org

¯\_(ツ)_/¯
♡۶♡۶ ♡۶
   
_______________________________________________
ejb-dev mailing list
ejb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/ejb-dev

Back to the top