Guice和JSR-330

Gon*_*gui 6 java dependency-injection guice jsr330

JSR-330根据包指定了某些命名约定,例如:

javax.inject.Inject
javax.inject.Scope
Run Code Online (Sandbox Code Playgroud)

Guice是JSR-330的参考实现.但是,在使用它时,您会注意到它不符合规范.例如:

com.google.inject.Inject
com.google.inject.Scope
Run Code Online (Sandbox Code Playgroud)

到目前为止我看到的任何参考实现都没有发生这种情况.是什么让Google Guice如此特别,以至于他们可以忽略他们正在实施的规范?

Jes*_*son 18

Guice 3支持JSR 330注释.它还支持com.google向早期版本的Guice向后兼容的注释(当JSR 330尚不存在时).