You certainly can do this.

My favorite way is to create a base class that implements the
javax.ejb.EntityBean interface.  You can handle methods like
setEntityContext() at the base class so you won't have to do it again.
Other methods you can either handle or mark as abstract.  Then, have your
concrete representations inherit from this class.

However, in your case, you might want to have three separate layers for
inheritance.  The first layer could be a base 'EJB' that implements generic
functionality (like setEntityContext()) and implements the EntityBean
interface.  The second 'layer' would be your base class for a generic
product.  The third 'layer' would then be the concrete implementations.


HTH


Jonathan




Ravikumar Kodwani wrote:
>
> Hi all,
> I am working on a project where I have to develop a entity bean which
> represents a product. But the product data which I am mapping to entity
> bean has some specific fields.
>
> Can I use inheritance here ie develop a general product entity bean and
> inherit it to develop specific product entity bean?
> If use kindly give guidelines how to?
>
> regards
> Ravi
>

--
Jonathan Baker

Senior Architect
Internet Applications Division
Sybase, Inc.

[EMAIL PROTECTED]
+1 510 922-0460

===========================================================================
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