I think the more elegant solution (Guice 2.0) would be to use private
modules:
http://google-guice.googlecode.com/svn/trunk/latest-javadoc/com/google/inject/PrivateModule.html

Avoiding work in modules is almost always a good thing, explained here:
http://code.google.com/p/google-guice/wiki/ModulesShouldBeFastAndSideEffectFree

Hope this helps
Robbie

On Wed, Jan 14, 2009 at 9:08 PM, Andrew Clegg <[email protected]>wrote:

>
> 2009/1/14 Rick <[email protected]>:
>
> > Thanks Andrew! This worked perfectly.  I owe you one.
>
> No probs :-)
>
> > Truthfully, I think this concept of using a Module to instantiate more
> than
> > one of the same type of object should be emphasized more in the docs, or
> > maybe in the wiki. I guess if you think of the Module somewhat analogous
> to
> > what you do with spring's xml file it starts to click with me. For the
> most
> > part I want to use annotations etc, but when you need more fine grained
> > control a Module could/would be the place to go next?
>
> Yeah, I do all sorts of things in them, reading external config files,
> setting up database connections, pre-populating collections even. And
> you can have different modules for test and production, and set up
> mocks etc. in the test ones. Very handy.
>
> Andrew.
>
> --
> New site launched: http://biotext.org.uk/
>
> I am retiring my old email addresses.
> Please use [email protected] where firstname = andrew.
>
> >
>

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