I am trying to understand dependecy injection.
I read a lot of articles, but the more I read, the more embarrassed.
So what I did is trying to understand some of the source code posted on the Google Guice page .
I realized that we need to create a module (ex: BillingModule ), where the binding between the interface and its implementation is performed:
bind(BillingService.class).to(RealBillingService.class);
And in the implementation class we have to inject constructor.
The problem is that I cannot understand the field injection :
@Inject Connection connection;
The question is simple: what does it mean?
source share