[webbeans-dev] Fwd: Patterns of reuse

Gavin King gavin at hibernate.org
Tue Dec 2 15:29:09 EST 2008


FYI

On Sun, Nov 30, 2008 at 3:11 PM, Evan Ireland <eireland at sybase.com> wrote:

> When you wrote:
>
>> 1. Pure implementation inheritance: we're only interested in
>> inheriting the Java code. The web beans metadata declared by the
>> supertype is irrelevant - the class we're extending may not even have
>> been intended for use as a web bean.
>
> Why would a supertype define web beans meta data if it is not intended
> for use as a web bean, as well as it is not intended for subtypes to
> inherit the meta data?
>
> Frankly, I think that ALL meta data should be inherited by default, unless a
> meta data item is specially marked as not being inherit

Well, ok let's discuss this.

First let's get clear what we are talking about here. These are the
kinds of metadata that exist:

* scope
* deployment type
* binding types
* name
* stereotypes
* type-level interceptor bindings
* method-level interceptor bindings
* initializer methods + injected fields
* producer/disposal/observer methods

Let's categorize them:

Things that probably should never inherit:
* deployment type

Things that probably should always inherit:
* scope
* stereotypes
* initializer methods + injected fields
* type-level interceptor bindings
* method-level interceptor bindings

Things that should only inherit in specialization case:
* binding types
* name

Things that only inherit in specialization and realization cases, with
"special" semantics:
* producer/disposal/observer methods

Does that classification make sense?

--
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list