Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] CDI future - problems and proposal

Hi,

Thanks for starting this Tomas.

CDI-Lite obviously takes up the bulk of the document, but nice to see the Other Updates section as well.

What might be an area for improvement as well is the way how Beans are created programmatically, and likewise how bean instances are being looked up programmatically.


For instance, there's no portable way to discover and apply interceptors to a bean returned from Bean#create(). For this Jakarta Security implementation Soteria, for instance, needs to define this SPI:


Which for Weld looks as follows:


Likewise, there's no good way to obtain the current InjectionPoint from the Bean#create() method. See https://issues.redhat.com/browse/CDI-610

For a Bean that is requested programmatically, specifically using CDI.current().select(), there's no way to provide it with an injection point. This means beans that depend on the injection point data can't be requested programmatically.

Programmatically adding an interceptor to a build-in bean is currently possible to do portably is possible, but takes a lot of ceremony. Specifically because there's no API or injection to get the "previous bean" from a producer. See https://arjan-tijms.omnifaces.org/2017/08/dynamically-adding-interceptor-to-build.html

Really would love to see these things addressed and/or contribute towards that. Specifically to support Jakarta Security (which is completely CDI based) and Jakarta Faces (which is increasingly moving to CDI).

Kind regards,
Arjan Tijms



On Thu, Oct 15, 2020 at 4:48 PM Tomas Langer <tomas.langer@xxxxxxxxxx> wrote:
Hello,

After seeing the turmoil related to CDI Lite and the new extension model for CDI, we have made an attempt to summarize the problems we see with CDI specification as it is now, and the possible path forward.


This document is not final, it's a draft. I am inviting the whole CDI community to read it and provide feedback by replying to this email thread or placing a comment in the document directly. Based on this feedback I'll modify the document and I hope step by step will come to the consensus in the design.

I have tried to preemptively answer some of the common questions, such as “can we handle this with existing portable extension”, and “why should this be in CDI, shouldn’t this be a separate specification”.

With best regards,
 Tomas Langer
 Helidon Architect
 Oracle


_______________________________________________
cdi-dev mailing list
cdi-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdi-dev

Back to the top