在谷歌吉斯,我能够基于与所述功能createInjector多个模块上创建的喷射器。

由于我使用GWT.create来实例化在GoogleGin喷射器,是有可能基于多个AbstractGinModule创建Ginjector。

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

有帮助吗?

解决方案

我用下面的代码来创建喷射器,其使用多个模块:

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

    AppPresenter getAppPresenter();

    PlaceManager getPlaceManager();

    EventBus getEventBus();
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top