[webbeans-dev] Re: WB get/addbean

Pete Muir pmuir at redhat.com
Wed Dec 3 06:27:11 EST 2008


The only way we can see this happening is if the user does something  
like:

manager.getInstance(new MyBean());

If we allow implicit add, this would currently cause the bean to be  
added using addBean() and then an instance returned. To me, this  
produces messy code that is hard to follow, so I think we should throw  
an exception if the bean isn't found.

On 8 Nov 2008, at 15:55, Gavin King wrote:

> Hum, that's a good question. I'll have to think about that one.
>
> I'm inclined to sy "no", but I can't think of a good reason.
>
> On Sat, Nov 8, 2008 at 2:42 AM, Nicklas Karlsson  
> <nickarls at gmail.com> wrote:
>> Is it OK to request a bean from mgr w/o calling addBean first? RI  
>> does
>> implicit add for deserialization lookup currently.
>>
>> --
>> Sent from Gmail for mobile | mobile.google.com
>>
>> ---
>> Nik
>>
>
>
>
> -- 
> Gavin King
> gavin.king at gmail.com
> http://in.relation.to/Bloggers/Gavin
> http://hibernate.org
> http://seamframework.org
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev




More information about the weld-dev mailing list