[weld-dev] Java SE extension

Gavin King gavin.king at gmail.com
Sat Nov 21 13:36:46 EST 2009


On Sat, Nov 21, 2009 at 10:47 AM, Pete Muir <pmuir at redhat.com> wrote:

> * I would prefer to not actually bootstrap Weld core inside the Weld constructor (I believe this should be an explicit step), hence the boot() method. We could rename this to initialize() for example. Opinions?

Fine by me. Especially since that at some stage we will need to pass
some kind of settings before booting.

> * What API do we want to expose to allow people to get hold of an Instance<?> ? IMO we need more syntatic sugar than offered by BeanManager. Do we want to just allow access to Instances (as above)?


Stick the following two methods on the object returned by initialize():

     Instance<Object> instance();
     Instance<Event> event();

So I can do:

   Weld weld = new Weld().initialize();
   weld.instance().select(Foo.class).get()
   weld.event().select(Bar.class).fire( new Bar() );
   weld.shutdown();

Or whatever.





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