One example is a Swing program.  All Swing components need to be
created on the Swing thread, which means that whichever Injector is
creating the Swing components needs to be done on the Swing thread.
You can construct the core of the program in one Injector, pass it
along to the UI, and then have the UI created as a child of the core
Injector.  That guarantees the child has access to the core, removes
the ability of the core to get any UI objects, and allows the UI to be
constructed in one thread while the core is constructed in its own
thread.

I'm sure there's a bunch more possible examples.

Sam

On Thu, Oct 23, 2008 at 5:18 PM, Mikkel Petersen <[EMAIL PROTECTED]> wrote:
>
> I took a look at it and I still don't feel that it solves this problem
> that I described in another post:
> configure() {
> binder.install(new MyModule("Bob"))
> binder.install(new MyModule("Bill"))
> }
>
> Where both mymodules binds some things that should only be bound
> locally but has global effect.
> My proposal to this was binder.bindLocally and binder.bindGlobally
> though I'm sure that probably has some unwanted sideeffects as well.
>
> Where would you use the childinjector ? I thought that you should just
> create and use your injector once ?
> I'm sure this is a very good thing but how and where to use it ?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to