[cdi-dev] [JBoss JIRA] Commented: (CDI-14) Add instance() method to BeanManager

Richard Hightower (JIRA) jira-events at lists.jboss.org
Wed May 11 11:50:20 EDT 2011


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

Richard Hightower commented on CDI-14:
--------------------------------------

Peter et al, good points. So Instance is the way to do this, and if you expose and instance, you can use instance. Got it. 

Lincoln, We wrote a utility class as well and we use that a lot. I don't think we are normal users (in every sense of the word) :). 

I just think adding a couple of extra methods that hide the details of Instance is a good idea for an easier to use API.
I am guessing that not everyone wants to be an expert on CDI, but they may want to grab a bean.

I know I was quite surprised the amount of learning curve it took me to just look a bean up by name. I compare this to the Spring applicationContext, which does have these types of methods. I just think that BeanManager should have some easy to use facade methods to do common things.

There are a lot of people who don't care so much about instance and low level details of CDI. They just want a darn bean. :)



> Add instance() method to BeanManager
> ------------------------------------
>
>                 Key: CDI-14
>                 URL: https://issues.jboss.org/browse/CDI-14
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Resolution
>    Affects Versions: 1.0
>            Reporter: Pete Muir
>             Fix For: 1.1 (Proposed)
>
>
> Currently obtaining a contextual reference is quite a complex operation, adding a method like:
> Instance<Object> instance();
> would make it much easier.

--
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