2

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 ?

X-Blaster
  • 1,751
  • 3
  • 15
  • 32

1 Answers1

7

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();
}
topchef
  • 19,091
  • 9
  • 63
  • 102