最近,當我與谷歌吉斯發揮各地,我試圖做這樣的事情:爲什麼Guice禁止綁定到提供者?
@Override
protected void configure() {
...
bind(Provider.class).to(ViewFactory.class);
...
}
其中ViewFactory
是:
public class ViewFactory implements Provider<SomeType> {...}
當然,吉斯沒有讓我這樣做returing錯誤:
1) Binding to Provider is not allowed.
{stacktrace}
爲什麼不能綁定到提供程序的原因是什麼?