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
posted
0
The Business Delegate object-oriented design pattern serves this purpose.
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
posted
0
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.
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.