[weld-dev] [jsr-299-eg] Updated spec with @BeanTypes and clarification of @New

Gavin King gavin.king at gmail.com
Tue Oct 20 10:12:24 EDT 2009


On Mon, Oct 19, 2009 at 8:24 PM, Roberto Chinnici
<Roberto.Chinnici at sun.com> wrote:

> So, 299 provides 2 mechanisms for discovery of a bean:
>
> * scanning of classes in archives with beans.xml
> * scanning of injection points with @New
>
>
> The second one is more scanning than we had in mind.

Well, actually, the second one is not really a scan. How it works is
by recursively chasing links (injection points) annotated @New from
enabled (scanned) beans.

I think a problem we have here is that I need to slightly change the
language of 3.12 to make it sound more like the old version in 3.8 of
the first public draft. So that folks understand this "recursively
chasing injection points annotated @New" stuff. The way it reads today
sounds almost like the container has to go off and actually create all
these Bean objects for every bean in the application. It doesn't.

I think a solution would be to say (in 3.12) that this "second bean"
is enabled if and only if it is referenced by an injection point
annotated @New. Then:

* it's clear that we are not creating thousands of Bean objects for
every bean in the app
* I can remove the special treatment of @New in the def of getBeans()
and Instance.get()

Does that make people feel more comfortable?


More information about the weld-dev mailing list