<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, &quot;Sebastian Łaskawiec&quot; &lt;<a href="mailto:slaskawi@redhat.com">slaskawi@redhat.com</a>&gt; 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>
&gt; Hi Sebastian,<br>
&gt;<br>
&gt; the &quot;superfluous&quot; constructor is required for client proxies (i.e. for<br>
&gt; normal-scoped beans). Weld may use non-portable JVM APIs that allow to<br>
&gt; allocate proxy instances without this constructor (Unsafe). The<br>
&gt; feature is called &quot;Relaxed construction&quot; [1]. Again, this feature is<br>
&gt; not portable.<br>
&gt;<br>
&gt; Martin<br>
&gt;<br>
&gt; [1]<br>
&gt; <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>
&gt;<br>
&gt;<br>
&gt; Dne 7.7.2015 v 14:18 Sebastian Łaskawiec napsal(a):<br>
&gt;&gt; Hey!<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve seen CDI 2.0 Early Draft - congratulations! Looks very promising!<br>
&gt;&gt;<br>
&gt;&gt; I would like to ask about something slightly different than CDI 2.0 -<br>
&gt;&gt; constructor injection. I&#39;m a big fan of using it because I can easily<br>
&gt;&gt; inject mocks into tested objects. This way I can limit the number of<br>
&gt;&gt; Arquillian tests and speed up testing phase in my project.<br>
&gt;&gt;<br>
&gt;&gt; However the drawback is that need 2 constructors in my beans:<br>
&gt;&gt;<br>
&gt;&gt; @ApplicationScoped<br>
&gt;&gt; public class MyBean {<br>
&gt;&gt;       public MyBean() {<br>
&gt;&gt;       }<br>
&gt;&gt;<br>
&gt;&gt;       @Inject<br>
&gt;&gt;       public MyBean(OtherBean bean) {<br>
&gt;&gt;       }<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; Is it possible to get rid of the zero-parameter constructor? I can<br>
&gt;&gt; imagine that it may be required by dependency resolution mechanism (for<br>
&gt;&gt; example instantiating beans with cyclic dependencies A -&gt; B -&gt; C -&gt; A),<br>
&gt;&gt; but on the other hand we actually can create an instance without calling<br>
&gt;&gt; a constructor - using Unsafe (but using Unsafe is always questionable).<br>
&gt;&gt;<br>
&gt;&gt; Could you please tell me if there are any plans around this topic?<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
&gt;&gt; Sebastian<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; cdi-dev mailing list<br>
&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;&gt;<br>
&gt;&gt; Note that for all code provided on this list, the provider licenses<br>
&gt;&gt; the code under the Apache License, Version 2<br>
&gt;&gt; (<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>
&gt;&gt; ideas provided on this list, the provider waives all patent and other<br>
&gt;&gt; intellectual property rights inherent in such information.<br>
&gt;&gt;<br>
&gt;<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>