문제

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 ?

도움이 되었습니까?

해결책

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();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top