Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

Support for parameter injection in CDI #16

Closed
mvcbot opened this issue Oct 16, 2014 · 9 comments
Closed

Support for parameter injection in CDI #16

mvcbot opened this issue Oct 16, 2014 · 9 comments
Milestone

Comments

@mvcbot
Copy link

mvcbot commented Oct 16, 2014

Original issue MVC_SPEC-4 created by Santiago Pericas-Geertsen:

Data binding in MVC will likely take advantage of injection in general, and parameter in injection in particular. Will CDI.next be able to handle the kind of parameter injection that MVC needs?

@mvcbot
Copy link
Author

mvcbot commented Jan 5, 2015

Comment by Santiago Pericas-Geertsen:

Layering on top of JAX-RS, this becomes more of a JAX-RS issue than an MVC one. However, since MVC is focused exclusively on CDI (unlike JAX-RS), we should look for opportunities to improve parameter injection.

@mvcbot
Copy link
Author

mvcbot commented Mar 9, 2015

Comment by Santiago Pericas-Geertsen:

Under discussion with CDI spec lead.

@mvcbot
Copy link
Author

mvcbot commented Mar 19, 2015

Comment by antoinesd:

You'll find my parameter injection POC here: https://github.com/antoinesd/CDI-Sandbox/tree/CDI-1.2/param-inject

@mvcbot
Copy link
Author

mvcbot commented Mar 19, 2015

Comment by Jozef Hartinger:

Who is calling the methods whose parameters should be injected? If it is the MVC implementation code calling them then there is no need for any further CDI support for this. The caller (MVC impl) can use the existing CDI SPI to obtain values for the parameters and call the method with these values.

@mvcbot
Copy link
Author

mvcbot commented Mar 19, 2015

Comment by Santiago Pericas-Geertsen:

It's actually done through JAX-RS. But that's beyond the point, there is no question that this can be done "manually". The point is that it shouldn't be done in multiple places (APIs) and possibly in incompatible ways; it should really be factored out and placed where it belongs which is CDI. As an example, JAX-RS supports its own parameter injection mechanism and has never been able to fully align with CDI, among other reasons, due to this missing feature.

@mvcbot
Copy link
Author

mvcbot commented Mar 19, 2015

Comment by Jozef Hartinger:

I see. So there is nothing actually preventing this right now. The painful point is that it requires several API calls and your request is to add an abstraction to CDI to cover those several steps in a single API call. Is that correct?

@mvcbot
Copy link
Author

mvcbot commented Jul 14, 2015

Comment by Manfred Riem:

Jozef, that is indeed correct. Is it possible to get that in the BeanManager API?

@mvcbot
Copy link
Author

mvcbot commented Mar 30, 2016

Comment by rmannibucau:

Like Antoine showed it is doable - even with CDI 1.0 - with a small glue code. Now for JAX-RS it is pretty clear to me it is not the way to go otherwise you would loose - or get in a not deterministic way - the JAX-RS bindings (@context, @xparam) which are not CDI instances - and will not be cause primitives for instance are not supported by CDI.

@mvcbot mvcbot added this to the 1.0-pr milestone Apr 26, 2017
@chkal chkal removed this from the 1.0-pr milestone Dec 18, 2017
@chkal chkal added this to the Future milestone Feb 11, 2018
@chkal chkal removed the enhancement label Aug 14, 2018
@chkal
Copy link
Contributor

chkal commented Jul 19, 2020

Moved to jakartaee/mvc#30

@chkal chkal closed this as completed Jul 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants