You mentioned a main() method.

I have a standalone application where I use Guice. I create the main
class (the one that is the root of the applications execution) via the
injector and any injections within that class are injected
automatically for me. This continues down the "injection hierarchy"
(if you can call it that) until Guice no longer has anything to inject
or fails due to a binding not being defined.

Depending on the context bootstrapping guice will be different, but
with a standalone app, a single injector should be more that
sufficient.

On Fri, Jul 24, 2009 at 8:43 AM, Asier<[email protected]> wrote:
>
> On 23 jul, 17:40, gpampara <[email protected]> wrote:
>> You would not need to create multiple injectors, a single injector is
>> sufficient. As you obtain an instance from the injector, all
>> injections within the original object you obtain will be injected as
>> well, in this way the injections cascade until the entire object graph
>> is built.
>
> Well... Perhaps I'm missunderstanding Guice's philosophy, but I'm a
> bit confused. I can't see how can I get an instance from a class out
> ouf the main method without creating an injector again. I don't get
> the point... is Guice thinked towars some kind of cascade d-i?
>
> Is there some example application of Guice in other domains than web
> applications?
>
> Thanks
> >
>

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