Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Communication between EJB  RSS feed

 
Rafael Angarita
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Business Delegate object-oriented design pattern serves this purpose.
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!