[cdi-dev] [JBoss JIRA] Commented: (CDI-92) Allow injection of Bean object for a bean

Marius Bogoevici (JIRA) jira-events at lists.jboss.org
Tue Sep 20 14:15:26 EDT 2011

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

Marius Bogoevici commented on CDI-92:

@Inject @Delegate means something else in the case of a Decorator anyway (and there's no delegate in the case of an interceptor). Also, I cannot see why there cannot be two separate concerns:

a) Inject the bean (which in the case of an Interceptor/Decorator will inject the Interceptor/Decorator itself, they're beans too, nothing wrong with that)

b) Inject the target instance or delegate. Since we don't have a common term for interception or decoration we could have two distinct identifiers:

@Inject @Intercepted Bean<?> bean; for interceptors

@Inject @Decorated Bean<?> bean; for decorators

One point against this would be the proliferation of annotations, but I think that using distinct annotations helps keeping the spec clear.

> Allow injection of Bean object for a bean
> -----------------------------------------
>                 Key: CDI-92
>                 URL: https://issues.jboss.org/browse/CDI-92
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Beans
>    Affects Versions: 1.0
>            Reporter: Pete Muir
>             Fix For: 1.1 (Confirmed)

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list