[webbeans-dev] Re: CreationalContext

Gavin King gavin at hibernate.org
Thu Jan 8 22:02:10 EST 2009


On Fri, Jan 9, 2009 at 5:35 AM, Scott Ferguson <ferg at caucho.com> wrote:

> Is there a need for a separate Contextual<T> or is it essentially Bean<T>?
>  I mean, it's fine, but I don't understand how the extra interface helps.

Oh, this was already introduced a few weeks ago. The reason for it was
that frameworks or the container sometimes want to just throw
something in the Context that is not actually a Bean. For example, it
lets the container associate a child manager with an arbitrary
context. It's not related to this proposal.


> (I'd prefer CreationContext, but that's a very minor preference.)
>
> Also, doesn't InjectionPoint include the <type,bindings> for
> getInstanceToInject?  How do the extra type, bindings parameters interact
> with the InjectionPoint values?

Haha, yes, you're right! Silly me :-)

> In other words, isn't it sufficient to define the following?
>
> class Manager {
>  Object getInstanceToInject(CreationContext cxt, InjectionPoint ip)
> }

Yes, of course.

-- 
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