<p dir="ltr">Hi</p>
<p dir="ltr">I d love to have it portable as well and dont really see a big blocker technically.</p>
<p dir="ltr">It wouldnt break backward compatibility in practise.<br>
</p>
<div class="gmail_quote">Le 7 juil. 2015 07:09, "Sebastian Łaskawiec" <<a href="mailto:slaskawi@redhat.com">slaskawi@redhat.com</a>> a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Martin for the explanation!<br>
<br>
Are there any plans to propagate this behavior to the spec?<br>
<br>
Thanks<br>
Sebastian<br>
<br>
On 07/07/2015 02:26 PM, Martin Kouba wrote:<br>
> Hi Sebastian,<br>
><br>
> the "superfluous" constructor is required for client proxies (i.e. for<br>
> normal-scoped beans). Weld may use non-portable JVM APIs that allow to<br>
> allocate proxy instances without this constructor (Unsafe). The<br>
> feature is called "Relaxed construction" [1]. Again, this feature is<br>
> not portable.<br>
><br>
> Martin<br>
><br>
> [1]<br>
> <a href="http://docs.jboss.org/weld/reference/latest/en-US/html/configure.html#relaxedConstruction" rel="noreferrer" target="_blank">http://docs.jboss.org/weld/reference/latest/en-US/html/configure.html#relaxedConstruction</a><br>
><br>
><br>
> Dne 7.7.2015 v 14:18 Sebastian Łaskawiec napsal(a):<br>
>> Hey!<br>
>><br>
>> I've seen CDI 2.0 Early Draft - congratulations! Looks very promising!<br>
>><br>
>> I would like to ask about something slightly different than CDI 2.0 -<br>
>> constructor injection. I'm a big fan of using it because I can easily<br>
>> inject mocks into tested objects. This way I can limit the number of<br>
>> Arquillian tests and speed up testing phase in my project.<br>
>><br>
>> However the drawback is that need 2 constructors in my beans:<br>
>><br>
>> @ApplicationScoped<br>
>> public class MyBean {<br>
>> public MyBean() {<br>
>> }<br>
>><br>
>> @Inject<br>
>> public MyBean(OtherBean bean) {<br>
>> }<br>
>> }<br>
>><br>
>> Is it possible to get rid of the zero-parameter constructor? I can<br>
>> imagine that it may be required by dependency resolution mechanism (for<br>
>> example instantiating beans with cyclic dependencies A -> B -> C -> A),<br>
>> but on the other hand we actually can create an instance without calling<br>
>> a constructor - using Unsafe (but using Unsafe is always questionable).<br>
>><br>
>> Could you please tell me if there are any plans around this topic?<br>
>><br>
>> Thanks<br>
>> Sebastian<br>
>> _______________________________________________<br>
>> cdi-dev mailing list<br>
>> <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
>><br>
>> Note that for all code provided on this list, the provider licenses<br>
>> the code under the Apache License, Version 2<br>
>> (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other<br>
>> ideas provided on this list, the provider waives all patent and other<br>
>> intellectual property rights inherent in such information.<br>
>><br>
><br>
<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.</blockquote></div>