English 中文(简体)
JSR 330 and Guice interoperability
原标题:

Does anybody have experience with JSR 330 vs Guice? From what I gather Guice is not an implementation of JSR 330 but if it is anything like Hibernate and JPA the implementation supports a bunch of additional functionality no in the API. Since I am already using GWT-Dispatch, Warp-persist guice-serlvet, etc would there be anything gained by moving to an EJB container supporting JSR 330?

最佳回答

Quoting the official announcement mail, FYI: JSR-330 support now in Guice SVN:

I ve implemented support for JSR-330 to Guice. This JSR standardizes annotations like @Inject and the Provider interfaces for Java platforms. It doesn t yet specify how applications are configured, so it has no analog to Guice s modules.

This new feature may cause pain for IDE users. Since there s now two @Inject annotations, IntelliJ etc. will prompt you when it needs an import. Either one will work, but the new dialogs will be quite annoying! Even worse, the two @Named annotations aren t (yet) equivalent. So if you apply the wrong annotation, you ll get a configuration error. I m thinking about ways to address this.

This work is ongoing. I recommend continuing to use the old com.google.inject annotations until the dust settles. http://code.google.com/p/google-guice/wiki/JSR330

This mail has been sent September 7, 2009. It s up to you to decide if the dust has settled but I d wait a bit more and stick with the guice annotations as recommended.

问题回答

Guice 2.0 does not support JSR 330, but Guice SVN includes a JSR 330-compatible injector.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签