<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV> </DIV>
<DIV>How embarassing, the first time I send a message to this list I accidently send it before I was done writing, sorry....</DIV>
<DIV>---------------</DIV>
<DIV> </DIV>
<DIV>I would maybe call the third case a 'subBean".</DIV>
<DIV> </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> </DIV>
<DIV>I imagine that the spec may have to be extended with a DI annotation like @SuperBean (@SuperBean like the @Decorates 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> </DIV>
<DIV><SPAN class=yshortcuts id=lw_1227893899_0 style="CURSOR: hand; BORDER-BOTTOM: #0066cc 1px dashed">public interface</SPAN> BaseType {</DIV>
<DIV> 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> public String getDescription() { return "BaseType"; }</DIV>
<DIV>}</DIV>
<DIV>
<DIV>@Decorator public SubTypeImpl implements SubType {</DIV>
<DIV> @SuperBean superBean;</DIV>
<DIV> public String getDescription() { return superBean.getDescription()+":SubType";</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV>So, the following expressions should be true...</DIV>
<DIV> </DIV>
<DIV>Bean baseTypeBean= ....;</DIV>
<DIV>Bean superTypeBean= ....</DIV>
<DIV> </DIV>
<DIV>baseTypeBean.create().getDescription().equals("BaseType");</DIV>
<DIV>superTypeBean.create().getDescription().equals("BaseType:SubType");</DIV>
<DIV> </DIV>
<DIV> </DIV> </DIV>
<DIV> <BR><BR>--- On <B>Thu, 11/27/08, Gavin King <I><gavin@hibernate.org></I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Gavin King <gavin@hibernate.org><BR>Subject: [webbeans-dev] Re: Patterns of reuse<BR>To: "Java Community Process JSR #299 Expert List" <JSR-299-EG@jcp.org>, "Matt Drees" <matt.drees@gmail.com>, "Scott Ferguson" <ferg@caucho.com>, "webbeans-dev@lists.jboss.org" <webbeans-dev@lists.jboss.org><BR>Date: Thursday, November 27, 2008, 4:34 PM<BR><BR><PRE>On Thu, Nov 27, 2008 at 4:09 PM, Gavin King <gavin@hibernate.org> 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
gavin.king@gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org
_______________________________________________
webbeans-dev mailing list
webbeans-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/webbeans-dev
</PRE></BLOCKQUOTE></td></tr></table><br>