Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Session Bean" Watch "Session Bean" New topic
Author

Session Bean

jake Michael
Greenhorn

Joined: Aug 30, 2002
Posts: 1
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

Joined: Jul 24, 2002
Posts: 401
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Session Bean
 
Similar Threads
inner class
statefull session bean
How to access CMR-fields in SessionBeans
Session bean extending other session bean
MK Notes and EJB in Action doubts