How embarassing, the first time I send a message to this list I accidently send it before I was done writing, sorry....
---------------
I would maybe call the third case a 'subBean".
I have also run into a problem regarding decorators of 'subBeans'.
The problem is that if I create a decorator of a subBean then I currently have no way of calling methods in the 'superBean'.
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).
@SuperBean would be used somelike this this...
public interface BaseType {
public String getDescription();
}
public class SubType extends BaseType {
}
@Decorator public BaseTypeImpl implements BaseType {
public String getDescription() { return "BaseType"; }
}
@Decorator public SubTypeImpl implements SubType {
@SuperBean superBean;
public String getDescription() { return superBean.getDescription()+":SubType";
}
So, the following expressions should be true...
Bean baseTypeBean= ....;
Bean superTypeBean= ....
baseTypeBean.create().getDescription().equals("BaseType");
superTypeBean.create().getDescription().equals("BaseType:SubType");
--- On Thu, 11/27/08, Gavin King <gavin@hibernate.org> wrote: From: Gavin King <gavin@hibernate.org> |