It's not a secret anymore!
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
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
Consider Paul's rocket mass heater.
subject: Inheritance in Java, J2EE
It's not a secret anymore!