I've been taking related resources and grouping them ... and creating
multiple modules for various things, to keep them more "together" as a
functional unit that can be added or removed. I then create my
Injector with:
injector = Guice.createInjector(new MainServletModule(),
new ResourceModule1(),
new OtherModule1(),
new ResourceModule2());
etc.
I find it helps me to keep things straight by keeping the module in
the same package as all the things being bound.
I think it's really a matter of personal taste, but this approach has
made me happier.
--C
On Fri, Apr 29, 2011 at 2:21 PM, garey <[email protected]> wrote:
> Hi -
>
> Still trying to figure out the best way to use Guice writing
> webapps. Should I put my bindings, for example a JNDI connection
> provider, into the servlet module, or should I write another module
> for that type of bind? And if I do, how should I provide the injector
> for that module to my servlets?
>
>
> Or am I completely confused?
>
> Garey Mills
>
> --
> 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.
>
>
--
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.