[
http://www.stripesframework.org/jira/browse/STS-520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11286#action_11286
]
Christian Nelson commented on STS-520:
--------------------------------------
I don't really see the benefit to using @Resource. To me it's marginally
better than @SpringBean in that it's a non-Spring annotation. And I don't see
the benefit of having one annotation that works for either Spring or Guice.
Especially since @Resource is somewhat overloaded in that it does different
things in different environments.
My original point was that I see a benefit to using the same
dependency-injection annotation(s) across all of the layers of an application.
@Autowired in the service tier and @Resource in the web tier is no better than
@Autowired (service) and @SpringBean (web), IMHO. @Autowired in both the web
and services layers makes things just a little more consistent and clean.
Of course this is made a little more complicated because Spring has its own
support for the standard @Resource annotation. Ideally, I would like to see
Stripes' Spring support handle @Autowired
(http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation),
@Resource
(http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-resource-annotation)
and @Qualifier
(http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-qualifier-annotation)
_exactly_ like Spring handles them.
I'm not sure what Guice support there is for Stripes, but my opinion is that
any Stripes/Guice support should use the standard Guice annotations. Spring
users stick with the annotations and behavior they're used to and Guice users
stick to what they're used to.
> Support Spring's @Autowired annotation for marking fields/methods for
> dependency injection
> ------------------------------------------------------------------------------------------
>
> Key: STS-520
> URL: http://www.stripesframework.org/jira/browse/STS-520
> Project: Stripes
> Issue Type: Improvement
> Affects Versions: Release 1.4.3
> Reporter: Christian Nelson
> Priority: Trivial
>
> It'd be nice if we could use the @Autowired annotation that was recently
> added in Spring 2.5 in place of the @SpringBean annotation. Dependency
> injection would then would be consistent with a spring-managed service tier.
> Obviously this isn't a big deal and I've marked it as trivial.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development