Instanciate an injector with multiple AbstractGinModule
Question
In google Guice, I can create an injector based on multiple module with the function createInjector
.
Because I use GWT.create
to instanciate the injector in GoogleGin, is it possible to create a Ginjector based on multiple AbstractGinModule
.
If we can't, how do you organize your code to avoid having all your binding in the same Module ?
Solution
I use the following code to create injector which is using multiple modules:
@GinModules({ ClientDispatchModule.class, MyClientModule.class })
public interface MyAppGinjector extends Ginjector {
AppPresenter getAppPresenter();
PlaceManager getPlaceManager();
EventBus getEventBus();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow