rocket mass heater kickstarter
The moose likes Beginning Java and the fly likes Inheritance in Java, J2EE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Inheritance in Java, J2EE" Watch "Inheritance in Java, J2EE" New topic

Inheritance in Java, J2EE

Nitin Bansal

Joined: May 22, 2002
Posts: 8
How to design inheritance for EJB, especially enity beans

SCEA 1/3
Bill Siggelkow
Ranch Hand

Joined: Jun 27, 2001
Posts: 57
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.

Bill Siggelkow
Jade Cove Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: Inheritance in Java, J2EE