|
JSR330
JSR-330 IntegrationThis documents an experimental, unreleased feature available in Guice SVN only JSR-330 standardizes annotations like @Inject and the Provider interfaces for Java platforms. It doesn't currently specify how applications are configured, so it has no analog to Guice's modules. Guice implements a complete JSR-330 injector. This table summarizes the JSR-330 types and their Guice equivalents.
Best PracticesFor now, stick with Guice's annotations and Provider interface. Mixing JSR-330 and Guice annotations is supported, but discouraged. In particular, using both @Named annotations can be quite clumsy, as it is hard to identify whose @Named is applied to a particular field or parameter. Similarly, using both Provider interfaces can cause difficultly, since they are not interchangeable. |
Sign in to add a comment