[webbeans-dev] Suggestion

Gavin King gavin at hibernate.org
Wed Dec 3 14:18:34 EST 2008


One thing that we could do, purely in the interest of simplifying the
spec is to

* eliminate the notion of disposal methods, and
* require that the web bean manager raise an event whenever it created
or destroys any web bean.

Then any web bean could react to creation or destruction of an object
using an observer method:

   void prepareFoo(@Observes @Created @SomeBinding Foo foo) { .... }

   void disposeFoo(@Observes @Destroyed @SomeBinding Foo foo) { .... }

This is not exactly semantically identical to a disposal method, since
disposal methods have the special quality that there is at most one
disposal method per producer method, whereas according to this
proposal, the number of observers of one of these events is unlimited
(which is potentially more powerful and more error-prone).

It's just an idea - something we could do that would make the spec
simpler. I don't think it's necessarily an improvement.

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