You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Mark Struberg <st...@yahoo.de> on 2012/11/27 15:48:44 UTC

CDI-1.1 module handling

Hi folks!

There is currently a VOTE on the CDI EG about how to implement modularity.
It looks like a horizontal isolation approach will be selected.

I personally don't like that as this will NOT be backward compatible. Currently the BeanManager of the WebApp which receives the request will determine the Beans and Contextual Instances resolved for InjectionPoints and the Proxies. 

The EG likes to change this to switching the 'responsible' BeanManager depending on the JAR you are in. Similar to what EJBs do with switching the ThreadContextClassLoader. 


I'm not yet sure how to implement this to be honest. E.g. it's absolutely impossible to do this for @Dependent Beans which gets created in a producerMethod or field. @Dependent scoped beans do not have any proxy to switch the TCCL around. I'm also strictly -1 for all this stuff in performance hindsight. It will e.g. not be possible anymore to do some Bean and instance caching in our resolvers and proxies. So we will be 5x slower in this modus...


At the end of the day we will need to implement a mode which is spec compatible at least. But noone says that this must be the preferred modus for OWB!


I'll keep you updated about the final decision.

LieGrue,
strub


Re: CDI-1.1 module handling

Posted by Joseph Bergmark <be...@apache.org>.
It doesn't sound incredibly dissimilar from the behavior that can be
enabled by turning on the by the use bda beans.xml scanner flag.  I
think currently that flag only controls interceptors, decorators &
alternatives based on what bean is being injected, but it could
feasibly also be aware of relationships between bdas and visibility
for injection purposes.

Sincerely,

Joe

On Tue, Nov 27, 2012 at 9:48 AM, Mark Struberg <st...@yahoo.de> wrote:
> Hi folks!
>
> There is currently a VOTE on the CDI EG about how to implement modularity.
> It looks like a horizontal isolation approach will be selected.
>
> I personally don't like that as this will NOT be backward compatible. Currently the BeanManager of the WebApp which receives the request will determine the Beans and Contextual Instances resolved for InjectionPoints and the Proxies.
>
> The EG likes to change this to switching the 'responsible' BeanManager depending on the JAR you are in. Similar to what EJBs do with switching the ThreadContextClassLoader.
>
>
> I'm not yet sure how to implement this to be honest. E.g. it's absolutely impossible to do this for @Dependent Beans which gets created in a producerMethod or field. @Dependent scoped beans do not have any proxy to switch the TCCL around. I'm also strictly -1 for all this stuff in performance hindsight. It will e.g. not be possible anymore to do some Bean and instance caching in our resolvers and proxies. So we will be 5x slower in this modus...
>
>
> At the end of the day we will need to implement a mode which is spec compatible at least. But noone says that this must be the preferred modus for OWB!
>
>
> I'll keep you updated about the final decision.
>
> LieGrue,
> strub
>