Comment by limpbizkit: *rbe5000*: the test is the same for both _Dependency Injection_ and _Dependency Injection with Guice_.
*alexnospam123*: take a look at [http://code.google.com/p/wave-protocol/source/browse/src/org/waveprotocol/wave/examples/fedone/ Google Wave Federation Protocol], which uses Guice. *phasmal*: your second example doesn't compile. Instead, you'd write the code at the end of the _Dependency Injection_ section: {{{ public static void main(String[] args) { CreditCardProcessor processor = new PaypalCreditCardProcessor(); TransactionLog transactionLog = new DatabaseTransactionLog(); BillingService billingService = new RealBillingService(creditCardProcessor, transactionLog); ... } }}} This approach works! But if your PaypalCreditCardProcessor and DatabaseTransactionLog have dependencies of their own, this setup can get out of control. Guice addresses that problem with modules. For more information: http://code.google.com/p/google-guice/wiki/Motivation --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice-dev" 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-dev?hl=en -~----------~----~----~----~------~----~------~--~---
