> * "Changed the specification of the return value type of the
> ejbCreate(...) methods for entities with
> container-managed persistence. The previous specification required that
> the ejbCreate methods are
> defined as returning void. The new requirement is that the ejbCreate
> methods be defined as return-ing
> the primary key class type. The implementation of the ejbCreate method
> should return null. This
> change is to allow tools, if they wish, to create an entity bean with
> bean-managed persistence by sub-classing
> an original entity bean with container-managed persistence."
> Aahh.. this is a goodie, and more important than what you might think.
> My server, XS, actually was designed for this at first (i.e. subclassing
> beans to provide CMP). It was only late in my implementation that I
> realized that I needed the above to make it work. This addition will let
> tool vendors make generic CMP managers that can be used with *any* EJB
> container which is, of course, very good.
Sub-classing is not the only way to accomplish what you are describing. We
have used the Extendor-pattern (Gamma et. al. I suppose) for our
EJB-container (for internal use). This gives all the good aspects, and also
eliminates the risque of breaking the "is-a" rule.
We have discussed this pretty thouroughly and we pretty much consider the
Extendor-pattern to be the "morally correct" way to do this. There is a
danger of over-stepping the rule of "is-a" when using inheritence, which we
think one are doing by extending av CMP with a BMP. The contracts that a
apply to a CMP does not apply to a BMP (ie. it is not a clear extension of
the contracts, see rules of design by contract), and therefor the
"is-a"-rule does not apply. Of course, this can be discussed, and the danger
of using built-in inheritance for doing this is in this case not so
dangerous as it would be in other places since the only one that should be
holding a direct reference to a bean is the container.
Probably is Sun aware of this but has been forced to change the spec from
it's partners.
===========================================================================
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".