Hello Guys,
We want to introduce stubbing in our Project using guice. Therefor we
have Stub Implemenations of our Service Interface which we would like
to inject instead of our productive ones when running the application
in testing mode (set via system property flag or property file). The
stubbing code should not be available in the productive system. So the
idea is to have separate modules one for stubbing an one for
production. For Guice 2.0 I already saw an Module Class containing an
override method. Is this supposed to be used for such a usecase. As
long we stick to Guice 1.0 we do not have this possibility directly
provided by Guice, could someone recommend an aquivalent solution /
best practice for Guice 1.0?
First i considered to use a provider combined with an enum (as
proposed in http://tinyurl.com/dljxta ) instead of a different Module,
but this would lead to dependencies from the production code to the
stubbing code.
The only possible solution i see for now is using reflection to load
the module, but maybe you have an more sophisticated approach.

Thanks for any help
Kind regards
Johannes

PS: As a Spring user i maybe stick to much to the spring solution
using different ids for my beans and using a variable  to decide with
beans to use.

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