Laird Nelson wrote:
>Phew; I'm glad I'm wrong, because that apparently means I CAN do this
>after all:
>  public class Party implements EntityBean {
>  }
>  public class Individual extends Party {
>
> }
>I sure *thought* I couldn't.  I *thought* that's what the spec. was
>saying.  Oh well; learn something new every day.

You can do this. EJB implementation inheritance is allowed since
create and findByPrimaryKey methods of a bean instance are not
exposed to clients.

Your class 'Individual' above can inherit create and findByPrimaryKey
methods from the base class 'Party'.

The real problem is with Home interface inheritance. Assume your
'Individual' Home interface inherits from 'Party' Home interface.
The Home interface of an EJB must return an instance of its EJBObject.
Your 'Party' Home interface returns a 'Party', but what will your
'Individual's Home interface return? It needs to return an instance
of 'Individual', but it can't because that breaks Java inheritance
rules with regards to method signatures.

Hamid

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to