在google Guice中,我可以使用该功能创建基于多个模块的注入器createInjector.
因为我用来GWT.create在GoogleGin中实现注入器,是否可以基于多个创建一个Ginjector AbstractGinModule.
如果我们不能,您如何组织代码以避免在同一个模块中拥有所有绑定?
我使用以下代码创建使用多个模块的注入器:
@GinModules({ ClientDispatchModule.class, MyClientModule.class })
public interface MyAppGinjector extends Ginjector {
AppPresenter getAppPresenter();
PlaceManager getPlaceManager();
EventBus getEventBus();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1162 次 |
| 最近记录: |