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.