[cdi-dev] [JBoss JIRA] (CDI-590) Provide a way to produce any type in a producer

Romain Manni-Bucau (JIRA) issues at jboss.org
Tue Mar 22 08:38:00 EDT 2016


    [ https://issues.jboss.org/browse/CDI-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13180518#comment-13180518 ] 

Romain Manni-Bucau commented on CDI-590:
----------------------------------------

[~manovotn] configuration is a very common use case cause you often rely on a library which already does the conversion and sometimes even map a complex type. Also if you integrate with Spring, Pico, Guice, ... you need that or you have to write an extension which is not as trivial as it should. Rephrased this case handles CDI-X integration in a generic manner and in a simple way compared to have to 1. scan the X library beans (thing you can't do sometimes) 2. create a XBean 3. register bean you *suppose* you will need (you obviously miss the programmatic lookup approach).

> Provide a way to produce any type in a producer
> -----------------------------------------------
>
>                 Key: CDI-590
>                 URL: https://issues.jboss.org/browse/CDI-590
>             Project: CDI Specification Issues
>          Issue Type: Epic
>            Reporter: Romain Manni-Bucau
>
> Note: this is a follow up "adding generic producers to CDI 2.0?" thread on the list
> It is common to rely on a subsystem (another IoC, a coercing system, ...) to produce values. Today a producer can't say "I produce anything in a safe" manner.
> Idea would be for injection point aware producers with a qualifier to producer Object and match all types.
> It needs another flag (can be in @Qualifier or another annotation it is not really important) to say "I produce safely any type".
> I did a PoC on github: https://github.com/rmannibucau/generic-producer-cdi but think it can be a nice feature of CDI 2.0 since it would avoid users to have to dig into extensions for several simple cases (configuration, bridge to other IoC...)



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list