Comment by [email protected]:

@Provides @PayPal
  CreditCardProcessor providePayPalCreditCardProcessor(
      @Named("PayPal API key") String apiKey)

What if your class requires another object instance that is not a constant? My understanding of the above is that "PayPal API key" is set up as a constant in your Module's configure() method.

For instance. I have a class that is dependent on a java.io.File instance. When the application needs an instance of this class it would pass along a specific instance of java.io.File (if I were using traditional new statement). I do not see how this is possible with Guice. There is no way to pass along a parameter to the constructor unless it is a constant. Help.

For more information:
http://code.google.com/p/google-guice/wiki/ProvidesMethods

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to