On Fri, Jul 24, 2009 at 6:35 PM, Asier <[email protected]> wrote:

>
> On 24 jul, 10:17, Kwhit <[email protected]> wrote:
> > Yes I found myself making the same mistake outlined by Gary. Start
> > thinking of your core entities in your design as standalone.  Have
> > @Inject public MyClass(...) constructor that will be given all the
> > dependencies you need. Then you can unit test it.
>
> Ahhhh... I see now.
>
> From main() method I can inject the biggest pieces of the application
> in the constructor, and make this pieces get injected with his own
> components... Ok, it's some kind of "thinking reverse": it's like the
> componets already are there and they are standalone components.


Exactly, it's called the Hollywood principle: "Don't call us, we'll call
you". Or more pedantically, inversion of control.

Dhanji.

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