I have been using google-guice for few months now. I'm quite satisfied with it, but it seems that i'm using it wrong. I'm creating a lot of assisted-injection and sometimes two injectors.
Hence i would like to understand the general principle here.
Does one should have one injector for the all application that wires everything from the main class ?
Would the best practice be about, trying to inject has much in the constructor from the start of the application ? (i see the advantage in testing)
My main problem with this is that sometimes i feel like the creation of some groups of objects belong to certain component. That there is a need to encapsulate that? How would you deal with that?
When you have an important deep structure of interconnected lservices, how do you do to pass the injector or the object required. You must find a way ? I have resorted a lot in assisted injection.
Even when the parameter could have been created outside of the object, i still prefer to let the service create the parameter and pass it to the assisted factory. Because the creation of the parameter sometimes involve some logic that belongs to the service (sometimes)
Any suggestion would help
Many thanks