dev@glassfish.java.net

Re: question on _at_Extract, _at_Inject, annotations

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Fri, 18 Jan 2008 13:28:13 -0800

Jerome Dochez wrote:
> ok I think it would be ok yes, we then make name() a mandatory attribute
> of the @Extract annotation. anyone else want to comment before we commit ?

Even with explicit names you have to handle conflicts so the behavior
there needs to be well defined.

Whether you should always require a name to be specified or whether
defaulting the name to (e.g.) the class name is acceptable seems to
depend on how often you expect there to be conflicts. If it's very
common that a given type is extracted from multiple services, then
you probably want to require a name. If < 20% of the services will
extract conflicting objects, then a default name is probably worthwhile.

And if we don't know which is best right now, just pick one approach
and we'll change it later when we know more.