使用多个AbstractGinModule实现一个注入器

X-B*_*ter 2 gwt gwt-gin guice

在google Guice中,我可以使用该功能创建基于多个模块的注入器createInjector.

因为我用来GWT.create在GoogleGin中实现注入器,是否可以基于多个创建一个Ginjector AbstractGinModule.

如果我们不能,您如何组织代码以避免在同一个模块中拥有所有绑定?

top*_*hef 7

我使用以下代码创建使用多个模块的注入器:

@GinModules({ ClientDispatchModule.class, MyClientModule.class })
public interface MyAppGinjector extends Ginjector {

    AppPresenter getAppPresenter();

    PlaceManager getPlaceManager();

    EventBus getEventBus();
}
Run Code Online (Sandbox Code Playgroud)