<html><body bgcolor="#FFFFFF"><div>I need to see a more realistic usecase. Why does subtypeimpl even need to decorate the method that was already decorated by basetypeimpl?&nbsp;<br><br>Sent from my iPhone</div><div><br>On Nov 28, 2008, at 11:50 AM, Ted Stockwell &lt;<a href="mailto:emorning@yahoo.com">emorning@yahoo.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;"><div>&nbsp;</div>
<div>How embarassing, the first time I send a message to this list&nbsp;I accidently send it before I was done writing, sorry....</div>
<div>---------------</div>
<div>&nbsp;</div>
<div>I would maybe call the third case a 'subBean".</div>
<div>&nbsp;</div>
<div>I have also run into a problem regarding decorators of 'subBeans'.</div>
<div>The problem is that if I create a decorator of a subBean then I currently have no way of calling methods in the 'superBean'.</div>
<div>&nbsp;</div>
<div>I imagine that the spec may have to be extended with a DI annotation like&nbsp;@SuperBean (@SuperBean like the @Decorates&nbsp;annotation only it is set to a reference that delegates calls to the superBean instead of the the next method in the current stack of interceptors for the subBean).</div>
<div>@SuperBean would be used somelike this this...</div>
<div>&nbsp;</div>
<div><span class="yshortcuts" id="lw_1227893899_0" style="CURSOR: hand; BORDER-BOTTOM: #0066cc 1px dashed">public&nbsp;interface</span> BaseType {</div>
<div>&nbsp;&nbsp;&nbsp; public String getDescription();</div>
<div>}</div>
<div>public class <span class="yshortcuts" id="lw_1227893899_1">SubType</span> extends BaseType {</div>
<div>}</div>
<div>@Decorator public BaseTypeImpl implements BaseType {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; public String getDescription() { return "BaseType"; }</div>
<div>}</div>
<div>
<div>@Decorator public SubTypeImpl implements SubType {</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; @SuperBean superBean;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; public String getDescription() { return superBean.getDescription()+":SubType";</div>
<div>}</div>
<div>&nbsp;</div>
<div>So, the following expressions should be true...</div>
<div>&nbsp;</div>
<div>Bean baseTypeBean= ....;</div>
<div>Bean superTypeBean= ....</div>
<div>&nbsp;</div>
<div>baseTypeBean.create().getDescription().equals("BaseType");</div>
<div>superTypeBean.create().getDescription().equals("BaseType:SubType");</div>
<div>&nbsp;</div>
<div>&nbsp;</div>&nbsp;</div>
<div>&nbsp;<br><br>--- On <b>Thu, 11/27/08, Gavin King <i>&lt;<a href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>&gt;</i></b> wrote:<br></div>
<blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Gavin King &lt;<a href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>&gt;<br>Subject: [webbeans-dev] Re: Patterns of reuse<br>To: "Java Community Process JSR #299 Expert List" &lt;<a href="mailto:JSR-299-EG@jcp.org">JSR-299-EG@jcp.org</a>&gt;, "Matt Drees" &lt;<a href="mailto:matt.drees@gmail.com">matt.drees@gmail.com</a>&gt;, "Scott Ferguson" &lt;<a href="mailto:ferg@caucho.com">ferg@caucho.com</a>&gt;, "<a href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a>" &lt;<a href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a>&gt;<br>Date: Thursday, November 27, 2008, 4:34 PM<br><br><pre>On Thu, Nov 27, 2008 at 4:09 PM, Gavin King <<a href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>> wrote:

> In case 1, it doesn't really make sense to inherit any web beans
> metadata to the subtype. In cases 2 and 3, it makes sense to inherit
> everything that is not explicitly overridden.

Minor clarification: in case 3, it does not make sense to inherit
binding types - rather, the user should be forced to *explicitly*
redeclare the binding types.

In case 2, binding types are inherited.



-- 
Gavin King
<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>
<a href="http://in.relation.to/Bloggers/Gavin">http://in.relation.to/Bloggers/Gavin</a>
<a href="http://hibernate.org">http://hibernate.org</a>
<a href="http://seamframework.org">http://seamframework.org</a>
_______________________________________________
webbeans-dev mailing list
<a href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a>
</pre></blockquote></td></tr></tbody></table><br>

      </div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>webbeans-dev mailing list</span><br><span><a href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a></span><br></div></blockquote></body></html>