> From: A mailing list for Enterprise JavaBeans development
> [mailto:[EMAIL PROTECTED]]On Behalf Of Kenneth D. Litwak
> I've been told that inheritance is not applicable to EJBs, but I can't see
> why. If I have a session bean that is a shopping cart, I see no particular
> reason Ic an';t subclas that to a special kind of shoppng cart. If I have an
> entity bbean which represents a customer, I don'tsee any particular reason to
> not subclass that into multiple kinds of cusotmers. What's the issue here?
You can use inheritance at the language level but not at the EJB level. More
precisely, finders and creates() on homes will not return subclasses of what was
declared in their signature. There are a bunch of issues there, some related to
the absence of covariance in Java (although this can be alleviated by returning
collections) and more complex ones with classloaders and finding the "best match"
when a requested class cannot be found.
I don't see any of those are definite showstoppers, though (it's only code we're
talking about after all) but I do believe that including this in the specification
would have made it thicker by several dozen pages :-)
--
Cedric
===========================================================================
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".