Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling SLSB from MDB

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Currently I have a MDB which listens to a Topic. The moment it recieves a message it needs to invoke the business logic methods encapsulated in Stateless Session Beans.

Should i write all the SLSB access code in MDB's onMessage method or should i keep all access code in a separate class & then create an instance of the this class in the MDB & invoke the method which encapsulates all the access code.

Do let me know which would be a better approach

Thanks

Manish
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is totally an architectural issue, which people around here would only be guessing at since we don't know the issues surrounding your application. Basically, is there some reason why you need to de-couple your MDB from your SLSB? If so, go for it. If not, why are you bothering? Each approach has merit within different contexts.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would go with the second approach, since it has a lot of OO design value. You might consider implementing a Service Locator that could be reused throughout your application as well.
 
david lightman
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
excellent advise on using the ServiceLocator. I have MDB's that eventually call SB using this method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic