aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Communication between EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Communication between EJB" Watch "Communication between EJB" New topic
Author

Communication between EJB

Rafael Angarita
Ranch Hand

Joined: Jan 09, 2009
Posts: 67
Hello,

I'm creating a distributed application using EJB3 and I want to know how to do the communication between my ejb objects. I think it would be such a mess having explicit calls to my session beans inside others session beans.

I was searching for EJB3 design patterns but I haven't found anything really clear and updated yet.

I'd really appreciate your advise.

Thank you very much.


Rafael Angarita.
SCJP 6.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
The Business Delegate object-oriented design pattern serves this purpose.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

For interaction with ejbs, I have found the Session Facade pattern most useful. Especially when transaction calls spawn multiple ejbs.

ram.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
The Session Facade pattern is typically applied for communication between a Presentation-tier object, e.g. Business Delegate, and a Business tier Session EJB.

This post however is about communication "between" Session EJB which are "already" on the Business tier.

A Business-tier Business Delegate then will easily facilitate communication "between" Session EJB.


Presentation tier

Business tier

Integration tier
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

The impression I formed was that the OP did not have distinct coarse grained/fine grained ejbs.
In such cases a call to the ejb layer results in a lot of criss cross calls between fine grained ejbs sometimes force creating coarse grained beans on the ejb layer without even knowing it. Which is why I suggested taking a step back and addressing the cause at the root - have a robust session facade ejbs fronting.

Of course if the problem is not what I have outlined above, then session facade is not the right option.

ram.

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Communication between EJB
 
Similar Threads
ejb 3.0 vs ejb 2.0 vs Hibernate revisited
EJB 3... why should I learn it?
Component Diagram Question
Difference between EJB2 and EJB3?
difference between jsf beans and ejb