ejb@glassfish.java.net

Re: default remote and local business interface from indirectly-implemented interfaces

From: Kenneth Saks <Kenneth.Saks_at_Sun.COM>
Date: Wed, 01 Mar 2006 12:25:22 -0500

Sanjeeb Kumar Sahoo wrote:

> Hi Ken,
>
> Kenneth Saks wrote:
>
>
> Although you made very clear that component defining annotations are
> not inherited, I have a feeling we are making developer's life
> difficult by not having consistent rules.

Hi Sahoo,

I agree that consistency is an important goal but it's not the only one.
 In this case allowing component-defining annotations and structural
bean annotations on any class in the hierarchy introduces a lot of
complexity for a use-case(session bean *component* inheritance) that
hasn't been particularly important. This would have made both the
semantics of the annotation processing much more intricate as well as
the annotation/xml overriding behavior.

Developers can still use super-classes to share or refactor
implementation and they can implement the same business interface in
more than one session bean. In EJB 3.0 they can implement more than one
local and/or remote business interface in the same session bean as well.

Your point regarding consistency was definitely followed when it comes
to the group of component dependency annotations ( @EJB, @Resource,
@PersistenceUnit, etc.) All of these have a name() attribute that
corresponds to its location relative to java:comp/env, all have the same
defaulting rule for that name, all can be declared on the super-class of
any class that supports such annotations, etc.

 --ken

> e.g. Platform spec(section #5.2.3) allows resource annotations to
> appear in any of the super classes in a component's inheritance
> hierarchy.
>
> Thanks,
> Sahoo
>