This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
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.
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.
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.