Hi,
I recently started to learn Guice. Let's consider this example from
https://code.google.com/p/google-guice/wiki/Motivation .
public static void main(String[] args) {
Injector injector = Guice.createInjector(new BillingModule());
BillingService billingService = injector.getInstance(BillingService.class);
...
}
This makes me think about :
Is it a good practice to create one injector per application (in a static
field) and then make that globally available via a public static method ?
Then use that injector instance everywhere instead of new (given that there
are no circular dependencies) ?
Cheers,
Jozsef
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.