• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inheritance in Java, J2EE

 
Nitin Bansal
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to design inheritance for EJB, especially enity beans
 
Bill Siggelkow
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inheritance in EJBs is not straightforward ... the main thing to keep in mind is that your bean implementation class can inherit from a base class ... however, your home and remote interfaces generally cannot. Typically, I use inheritance in EJBs only to provide some default implemenation of methods (such as the setEntityContext()), ejbActivate(), ejbPassivate(), etc. In this sense, this pattern is more of an adapter.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic