[webbeans-dev] NewXxxxxBean

Gavin King gavin at hibernate.org
Mon Jan 12 18:59:36 EST 2009


Yes, ok, pete explained this to me after i sent the email.

On Tue, Jan 13, 2009 at 7:50 AM, Nicklas Karlsson <nickarls at gmail.com> wrote:
> On Mon, Jan 12, 2009 at 6:26 PM, Gavin King <gavin at hibernate.org> wrote:
>> wouldn't it be better to implement a single NewBean, that wraps and
>> delegates to the SimpleBean or EnterpriseBean?
>
> Yes. But if we have a delegating bean that overrides stuff according
> to the specification, e.g.
>
>   @Override
>   public Class<? extends Annotation> getScopeType()
>   {
>      return Dependent.class;
>   }
>
> and then e.g Create looks like
>
> public T create() {
>  return getDelegate().create();
> }
>
> we end up in the delegate and the it happily uses its own
> getScopeType(), unaware on that it has been wrapped.
>
> And if we override create() we have the problem of the different
> create implementations for SimpleBean and EnterpriseBean
>
> Or?
>
> ---
> Nik
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list