[
https://issues.jboss.org/browse/CDI-14?page=com.atlassian.jira.plugin.sys...
]
Pete Muir commented on CDI-14:
------------------------------
Rick, I think this points more to a communication issue than an API failing. BeanManager
is intended as a low level API (in fact it is even labeled an SPI). Instance<> is
intended as a user application facing API (so not low level at all). It's far more
user friendly than BeanManager (it *just* focuses on the case of programmatic
instantiation, none of the other stuff that is on BeanManager), and offers exactly the
methods you want. In fact Lincoln's utility would
a) introduce a smaller learning curve
b) be more powerful
if rather than inventing a new API for this, simply allowed you to look grab an
Instance<> (to be fair it took me well over a year to even realise this problem was
trivial to address as well ;-).
So in response to your "Spring app context" point, what I would say is that the
issue isn't that BM doesn't have the right methods, it's just that
a) you were looking in the wrong place
b) the spec did a very very bad job of showing you the right place to look (actually it
showed you the wrong place!)
Let's fix this.
Rick, open an issue for allowing Instance to do a name based selection and give your use
cases there.
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