I was going through the google guice and then i thought about how it might 
be working.

So This is my theory on how property injector might be working.

Guice first wants us to create a injector and pass all the binding information 
to it.

Injector injector = Guice.createInjector(new BillingModule());

*code snippets from google guice 
page<https://code.google.com/p/google-guice/wiki/GettingStarted>

OK at this point i can think that there is a class with all the information 
of binding.

and when we do

injector.getInstance(RealBillingService.class);

Here we do the trick.

injector will return a proxy instance for the real RealBillingService object 
and when we call a

method of RealBillingService object, proxy instance invocation handler uses 
reflection to

figure out the properties to inject and fullfill it based on the 
information passed during the creation of injector.

*QUESTION*

This is the way i suppose, the guice works. If i am wrong, what would be 
the actual way by which 'Guice'achieve it ?

If this is the way guice work then Guice always returns the proxy object and 
the user code always makes call on the proxy objects. is this true ?

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

Reply via email to