[cdi-dev] [JBoss JIRA] (CDI-170) Either ditch or fix @New

Jozef Hartinger (Commented) (JIRA) jira-events at lists.jboss.org
Wed Oct 26 08:38:46 EDT 2011


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

Jozef Hartinger commented on CDI-170:
-------------------------------------

Mark, I believe that your description of the problem is greatly inexact.

{quote}It is really only for creating injected but unmanaged and unintercepted instances of a class.{quote}

The spec says "For each managed bean, and for each session bean, a second bean exists which has the same interceptor bindings" --> Interception is supported.

{quote}Also you cannot @New classes which don't have a default ct.{quote}
Not sure what the missing verb is. Nevertheless, the spec does not require @New beans to have the default constructor.
                
> Either ditch or fix @New
> ------------------------
>
>                 Key: CDI-170
>                 URL: https://issues.jboss.org/browse/CDI-170
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Concepts, Contexts
>    Affects Versions: 1.0
>            Reporter: Mark Struberg
>             Fix For: 1.1 (Proposed)
>
>
> The specification of @New is currently not really usable. It is really only for creating injected but unmanaged and unintercepted instances of a class. But this usecase is weird and imo just not needed. If the class under construction is an 'old' Pojo (without @Inject, etc) then it doesn't need to get managed. And it also doesn't provide any benefit over just using new Pojo();
> Also you cannot @New classes which don't have a default ct.
> I just found no sane scenario where we cannot use a producer method instead.
> Can we simply deprecate @New?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the cdi-dev mailing list