<html><body>
<p><font size="2" face="sans-serif">FWIW I agree with Mark &amp; Stu, but isn't backwards compatibility a concern here for implementations that previously supported subclassing?</font><br>

<ul style="padding-left: 0pt"><font size="2" face="sans-serif">Sincerely,<br>
<br>
Joe<br>
</font></ul>
<br>
<img width="16" height="16" src="cid:1__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for Pete Muir ---09/18/2012 05:01:07 AM---I'm happy to go with whatever you guys agree on here :-) Marius"><font size="2" color="#424282" face="sans-serif">Pete Muir ---09/18/2012 05:01:07 AM---I'm happy to go with whatever you guys agree on here :-) Marius, I guess you are the only dissenter</font><br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">From:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Pete Muir &lt;pmuir@redhat.com&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">To:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Mark Struberg &lt;struberg@yahoo.de&gt;, </font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Cc:</font></ul>
</td><td width="100%" valign="middle"><img width="1" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">&quot;cdi-dev@lists.jboss.org&quot; &lt;cdi-dev@lists.jboss.org&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Date:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">09/18/2012 05:01 AM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Subject:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">Re: [cdi-dev] Subclassing?</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>

<ul style="padding-left: 4pt"><font size="1" color="#5F5F5F" face="sans-serif">Sent by:</font></ul>
</td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBF0EEDFD912098f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="1" face="sans-serif">cdi-dev-bounces@lists.jboss.org</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">I'm happy to go with whatever you guys agree on here :-)<br>
<br>
Marius, I guess you are the only dissenter now :-) WDYT?<br>
<br>
On 18 Sep 2012, at 07:46, Mark Struberg wrote:<br>
<br>
&gt; Hi Stu!<br>
&gt; <br>
&gt; +1, fully agree.<br>
&gt; <br>
&gt; <br>
&gt; LieGrue,<br>
&gt; strub<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; ----- Original Message -----<br>
&gt;&gt; From: Stuart Douglas &lt;stuart.w.douglas@gmail.com&gt;<br>
&gt;&gt; To: Mark Struberg &lt;struberg@yahoo.de&gt;<br>
&gt;&gt; Cc: Pete Muir &lt;pmuir@redhat.com&gt;; Romain Manni-Bucau &lt;rmannibucau@gmail.com&gt;; &quot;cdi-dev@lists.jboss.org&quot; &lt;cdi-dev@lists.jboss.org&gt;<br>
&gt;&gt; Sent: Tuesday, September 18, 2012 12:22 AM<br>
&gt;&gt; Subject: Re: [cdi-dev] Subclassing?<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; Mark Struberg wrote:<br>
&gt;&gt;&gt; Not sure if the trick with the ThreadLocal would work (aside from being dog <br>
&gt;&gt; slow).<br>
&gt;&gt;&gt; A-&gt;B-&gt;A should all lead to decorator invocations. Is this the case <br>
&gt;&gt; with your impl? (B might be another Decorator or a simple Bean)<br>
&gt;&gt; <br>
&gt;&gt; Depends if B is a normal scoped bean or not. I agree this is not ideal.<br>
&gt;&gt; <br>
&gt;&gt; To be honest I think it may actually be better to tighten the <br>
&gt;&gt; requirements for intercepted/decorated beans to allow interception to be <br>
&gt;&gt; implemented via a proxy. The way the CDI 1.0 spec was written this was <br>
&gt;&gt; not really possible to do and still be spec compliant (although the TCK <br>
&gt;&gt; did not test this), but we could change to 1.1 spec to require all <br>
&gt;&gt; intercepted classes to meet the proxiability requirements.<br>
&gt;&gt; <br>
&gt;&gt; Basically as I see it the pros/cons of each are:<br>
&gt;&gt; <br>
&gt;&gt; Subclassing:<br>
&gt;&gt; <br>
&gt;&gt; Pros:<br>
&gt;&gt; 1. Can use reflection to read fields / bean can have public fields<br>
&gt;&gt; 2. No proxiability requirement<br>
&gt;&gt; 3. Constructor is only called once<br>
&gt;&gt; <br>
&gt;&gt; Cons:<br>
&gt;&gt; 4. Self invocation cannot be handled consistently<br>
&gt;&gt; 5. Implementation is more complex<br>
&gt;&gt; 6. For normal scoped beans the bean has to be proxied anyway, so there <br>
&gt;&gt; is no advantage<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt; Proxying:<br>
&gt;&gt; <br>
&gt;&gt; Pros:<br>
&gt;&gt; 7. Consistent with all other interceptor behavior<br>
&gt;&gt; 8. Self invocation works as expected<br>
&gt;&gt; <br>
&gt;&gt; Cons:<br>
&gt;&gt; 9. Bean must meet proxiability requirements (although you can get around <br>
&gt;&gt; this with JVM specific hacks)<br>
&gt;&gt; 10. Constructor will be called twice<br>
&gt;&gt; <br>
&gt;&gt; I do not consider 1. to be worth considering as a real advantage (public <br>
&gt;&gt; fields == yuck). Basically the only advantage that sub classing has is <br>
&gt;&gt; when you are dealing with a dependent scoped bean that would not meet <br>
&gt;&gt; the proxyability requirements. I think in this case adding a default <br>
&gt;&gt; constructor to enable the bean to be proxied is not a big deal.<br>
&gt;&gt; <br>
&gt;&gt; Stuart<br>
&gt;&gt; <br>
&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; LieGrue,<br>
&gt;&gt;&gt; strub<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; ----- Original Message -----<br>
&gt;&gt;&gt;&gt; From: Stuart Douglas&lt;stuart.w.douglas@gmail.com&gt;<br>
&gt;&gt;&gt;&gt; To: Mark Struberg&lt;struberg@yahoo.de&gt;<br>
&gt;&gt;&gt;&gt; Cc: Pete Muir&lt;pmuir@redhat.com&gt;; Romain <br>
&gt;&gt; Manni-Bucau&lt;rmannibucau@gmail.com&gt;; <br>
&gt;&gt; &quot;cdi-dev@lists.jboss.org&quot;&lt;cdi-dev@lists.jboss.org&gt;<br>
&gt;&gt;&gt;&gt; Sent: Monday, September 17, 2012 11:31 PM<br>
&gt;&gt;&gt;&gt; Subject: Re: [cdi-dev] Subclassing?<br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; Mark Struberg wrote:<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;The main difference we get from subclassing is that even <br>
&gt;&gt; 'internal<br>
&gt;&gt;&gt;&gt; invocations' (contrary to 'external invocations') will <br>
&gt;&gt; invoke the<br>
&gt;&gt;&gt;&gt; decorator method<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;example<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;public Class A implements X {<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; public void methA() {..}<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; public void methB() { methA(); }<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;}<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;@Decorator<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;public class Adecorator implements X {<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; @Inject @Delegate X x;<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; public void methA();<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;}<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;If we do _not_ apply subclassing but proxying, then invoking <br>
&gt;&gt; methB will NOT<br>
&gt;&gt;&gt;&gt; trigger methA from Adecorator.<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;If we DO force subclassing, then a call to methB will also <br>
&gt;&gt; trigger the<br>
&gt;&gt;&gt;&gt; decorator!<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;But that is contrary to all other EE proxying behaviour so far...<br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; In weld we currently use a thread local to work around this, so self<br>
&gt;&gt;&gt;&gt; invocation does not result in interceptors / decorators running again.<br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt; Stuart<br>
&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;LieGrue,<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;strub<br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;----- Original Message -----<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;From: Pete Muir&lt;pmuir@redhat.com&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;To: Romain Manni-Bucau&lt;rmannibucau@gmail.com&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;Cc: <br>
&gt;&gt; &quot;cdi-dev@lists.jboss.org&quot;&lt;cdi-dev@lists.jboss.org&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;Sent: Monday, September 17, 2012 5:58 PM<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;Subject: Re: [cdi-dev] Subclassing?<br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;Romain,<br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;I agree, we can't specify to use subclassing. Please take <br>
&gt;&gt; a look at<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; </font></tt><tt><font size="2"><a href="https://github.com/jboss/cdi/pull/117">https://github.com/jboss/cdi/pull/117</a></font></tt><tt><font size="2">&nbsp;where I've tried to <br>
&gt;&gt; address<br>
&gt;&gt;&gt;&gt; this, in<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;terms of what effects people will see.<br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;On 17 Sep 2012, at 16:54, Romain Manni-Bucau wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;Hi,<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;There is a bunch of jira to specify subclassing should <br>
&gt;&gt; be used in<br>
&gt;&gt;&gt;&gt; some<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;cases so i mail here instead of answering all jira.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;IMO it is specifying too much the technical part: &nbsp;<br>
&gt;&gt; specify the<br>
&gt;&gt;&gt;&gt; constructor<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;should be called twice is better for a spec IMHO (but this <br>
&gt;&gt; case is not<br>
&gt;&gt;&gt;&gt; logical<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;at all ;))<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;Why this need?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;- Romain<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;_______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; cdi-dev@lists.jboss.org<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; </font></tt><tt><font size="2"><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></font></tt><tt><font size="2"><br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;_______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; cdi-dev@lists.jboss.org<br>
&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; </font></tt><tt><font size="2"><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></font></tt><tt><font size="2"><br>
&gt;&gt;&gt;&gt;&gt;&gt; <br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;_______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp;cdi-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; cdi-dev@lists.jboss.org<br>
&gt;&gt;&gt;&gt;&gt; &nbsp; </font></tt><tt><font size="2"><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></font></tt><tt><font size="2"><br>
&gt;&gt; <br>
<br>
<br>
_______________________________________________<br>
cdi-dev mailing list<br>
cdi-dev@lists.jboss.org<br>
</font></tt><tt><font size="2"><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></font></tt><tt><font size="2"><br>
<br>
</font></tt><br>
</body></html>