title: Guice per request module override?
body: <p>Something I have seen over and over again in the code base I work in is a scenario where multiple factories or other object deciders will take in the same parameter and decide on an implementation based on that parameter.  </p>
  
  <pre><code>interface Foo {
      foo();
  }
  
  interface Bar {
      bar();
  }
  
  class FooProvider {
  
      ... members constructor etc... 
  
      Foo get(BazType bazType) {
          switch (bazType) {
             case BAZ_A:
                return bazA;
             case BAZ_B:
                return bazB;
                ....
          }
      }
  }
  
  class BarProvider {
      Bar get(BazType bazType) {
          ...same as fooFactory
      }
  }
  
  ... more interfaces and providers follow
  </code></pre>
  
  <p>These providers(factories?  Not sure what to call them) will be called one or more times in the lifetime of a request in possibly different classes, but the BazType will be defined and final at the beginning of the request.  I find it redundant and potentially dangerous that we have to do this many times when it should only need to be done once.</p>
  
  <p>Is it possible to instead define the implementations and bind them all in a specific module and load the needed module on a per request/thread basis?  I see that there is a Modules.override() but that seems to be more of a one time thing to swap out production code for test or development code and not what I need.  Obviously I'm not going to want to create an injector for every request I serve.  </p>