[cdi-dev] BeanConfigurator and ProducerConfigurator consistency

Antonin Stefanutti antonin at stefanutti.fr
Fri Dec 23 05:30:39 EST 2016


Hi all,

Is there any reason I’m missing it is possible to get an Instance in BeanConfigurator produceWith (resp. disposeWith) while it’s not in ProducerConfigurator produceWith (resp. disposeWith)?

BeanConfigurator:

<U extends T> BeanConfigurator<U> produceWith(Function<Instance<Object>, U> callback);
BeanConfigurator<T> disposeWith(BiConsumer<T, Instance<Object>> callback);

ProducerConfigurator:

<U extends T> ProducerConfigurator<T> produceWith(Function<CreationalContext<U>, U> callback);
ProducerConfigurator<T> disposeWith(Consumer<T> callback);

Besides, wouldn’t that be more concise in most use cases to provide the equivalent without the Instance parameter in BeanConfigurator (as it was before CDI 2.0.Beta1)?

Thanks,
Antonin



More information about the cdi-dev mailing list