题
在谷歌吉斯,我能够基于与所述功能createInjector
多个模块上创建的喷射器。
由于我使用GWT.create
来实例化在GoogleGin喷射器,是有可能基于多个AbstractGinModule
创建Ginjector。
如果我们不能,你如何组织你的代码,以避免所有的在同一个模块绑定?
解决方案
我用下面的代码来创建喷射器,其使用多个模块:
@GinModules({ ClientDispatchModule.class, MyClientModule.class })
public interface MyAppGinjector extends Ginjector {
AppPresenter getAppPresenter();
PlaceManager getPlaceManager();
EventBus getEventBus();
}
不隶属于 StackOverflow