aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Can EJB's be used in this situation? 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 "Can EJB Watch "Can EJB New topic
Author

Can EJB's be used in this situation?

bhilla ratna
Ranch Hand

Joined: Jun 01, 2005
Posts: 59
I am trying to understand why EJB's are used in our situation. I am hoping some of you guys can make me reliaze if I am in right track.

We have a BusinessObjects that communicate with Presentation Tier and these business objects are calling EJB (Stateless Session)to perform business operations. In business object they are not really doing anything but just calling DataAccesObject layer and DataAccesObjects are doing the real work.

As for I know EJB's are used as Cotainer proides services like Security,Transaction,Scalability, Persistence. But in our case they are trying to maintain transactions them selves by creating Transaction classes.

So, I don't really see why they are using EJB's. Only thing I can think of is scalability.

Any thoughts?

Bhilla


Ratna bhilla<br />SCJP 1.4, SCBCD 1.3, SCWCD 1.4
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
I think scalability is the only thing for which your application is uisng EJB's.I have seen quite a few applications which had used EJB's just to use it.


Rahul Bhattacharjee
LinkedIn - Blog
Sunil Dixit
Ranch Hand

Joined: Sep 22, 2005
Posts: 46
Hi Ratna,
Yes you are right, scalability is one feature of EJB (session bean) but I would like to bring the fact that the most added advantage given by EJB is distributed computation.
As per me, you shd not EJB if you know that your business logic is not be distributed.
You can achieve the all the features (except distributed) given by EJB using spring. I will say more than that.
And if you application is already written on some framework than it is not easy to move your application to other framework/env. it cost lots of money to company.
So it is primarily design decision. So may be you business want distributed computation.
And don't beleive Rahul.. If you are using any Tech/framework than their are strong reasons to use those framework. If in your company their are using these tech for the sake of using than I will say you are at wrong place.
Hope that it will make sense to you.

Cheer,
Sunil Dixit
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Sunil Dixit:
And don't beleive Rahul..


Thanks Sunil.

Distributed computation is a way to achieve scalability.When we say scalability we mean that addition of resources to the existing infrastructure should be easy enough , that is offcourse not possible using a single system.That is why go for clusters ,as and when we feel that the existing nodes are not able to take up the load a new node can be added in the cluster.Apart from there two other important features that we achieve using this is fault tolerance and unpredicted crashing of some nodes.In case a node in the cluster is not working right , due to any reason.we can bring this down without any effect to the system.
So I think we go for distributed computing for scalability.Can we think of achieving scalability without using any distributed computing technology beneath.
Orem Hun
Greenhorn

Joined: May 24, 2005
Posts: 28
One advantage of using EJB3 for BOs is, if you need to add business logic later on, that would be better fit at BO than DAO.
bhilla ratna
Ranch Hand

Joined: Jun 01, 2005
Posts: 59
Thanks guys for your responses.

From my understanding EJB's are hevayweight components. Unless we justify our reasons(or have strong reasons) to go for it, they could be pain.

As a matter of fact, I am trying to research what are the possible middle tier options to replace with heavy weight EJB's

All I could think of is Spring.

Any other options used any where?

bhilla
Orem Hun
Greenhorn

Joined: May 24, 2005
Posts: 28
>> Any other options used any where?

JBoss Seam.

EJB3 are lightweight. We are planning to use them along with Seam framework.
 
jQuery in Action, 2nd edition
 
subject: Can EJB's be used in this situation?