It's not a secret anymore!
The moose likes EJB and other Java EE Technologies and the fly likes EJB vs Java Beans--design choice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB vs Java Beans--design choice" Watch "EJB vs Java Beans--design choice" New topic

EJB vs Java Beans--design choice

Yan Lee
Ranch Hand

Joined: Sep 15, 2003
Posts: 94
I am designing/coding a J2EE application. I am currently designing the business logic layer.
My requirements from the Business Logic Layer:
. interact with the database (CRUD operations) and create/update complex
composite value objects.
. perform standard shopping cart operations
So far, I have figured the following
. EJB Pros: container managed transaction management, connection pooling.
. Java Beans pros: No need for App server.
I wanted to know the pros-cons of using EJB's or Java Beans to execute the business logic of the application. What are the factors that will help me decide whether to use one or the other?
Thanks in advance.
B Wask

Joined: Oct 08, 2003
Posts: 5
Keep in mind that without EJBs, you'd have to write all of the persistence logic yourself, so you wouldn't really be saving any processing time. What sort of an application is this? If it's a web (JSP/Servlet) based app, then you're going to have to run Tomcat or somethine similar, so again you're really not gaining anything by not having an app server. I think you will find that, in virtually every case, the EJB based app provides a cleaner, more manageable solution.
Viswanatha GB

Joined: Sep 19, 2001
Posts: 16
Hi Intelli,
Here You have TWO quesrtions
1. Whether to go for Application Server/EJB container Or NOT
2. if you go for App Server, Is EJB is realy need or NOT.
It is all based on the kind of Application you are developing.
If your application need the following capabilities such as:
Session-level fail-over
Management consoles
Connection pooling
Load balancing
the go for App Server with EJB.
Else you can do it only a Java Class.

==============(**)=================<br />Viswanatha.G.B<br />Sr.Software Engineer<br />IBM<br />==============(**)=================
I agree. Here's the link:
subject: EJB vs Java Beans--design choice
It's not a secret anymore!