Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Bean

 
jake Michael
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What are the issues in having inheritance in session bean ? i have methods which are common across all beans like ejbActivate(), ejbCreate(), ejbPassivate(), ejbRemove(), setSessionContext(). Can i move it to a super class ? and have their implementation in the bean class.
Any links or sample code would be appreiciated ?
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use inheritence in the EnterpriseBean "Impl" class.
I have often put common and required methods in a base "AbstractEjbImpl" class to make my real impl classes simpler.
It's just like writing any other java class in this regard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic