users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: Implicit Producers

From: David Blevins <david.blevins_at_gmail.com>
Date: Wed, 11 Apr 2012 10:45:36 -0700

On Apr 11, 2012, at 4:33 AM, Pete Muir wrote:

> Do you have any specific ideas around what this would look like? It's a nice way to describe it :-)

Not sure I have anything I love.

The KISS approach would be to check the application to see if they are producing an X and, if so, don't implicitly add a producer for X.

The other path might be based on an added concept in CDI where some qualifiers are marked "required" and therefore must be present on the InjectionPoint for it to be considered a match.


-David


>
> On 11 Apr 2012, at 04:26, David Blevins wrote:
>
>> Another concrete topic on aligning things (noticed this in some of the matrices).
>>
>> Many times it has come up that we want to make more things injectable via @Inject at the platform level. I'm totally on board with that and have been doing some of the suggesting.
>>
>> I've started mentally calling them "implicit" producers as effectively what we're doing is adding producers to applications that weren't explicitly created by the application.
>>
>> As a large number of applications in existence will already have producer methods or fields that produce various JavaEE resources currently only available via @Resource, @EJB, etc. there is a bit of a compatibility issue.
>>
>> Even if we add producers with full spec-standard qualifiers, any existing injection points that do not use qualifiers become ambiguous.
>>
>> It would be great to hear some thoughts on how to solve that.
>>
>>
>> -David
>>
>