[ 
http://www.stripesframework.org/jira/browse/STS-520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11289#action_11289
 ] 

Gregg Bolinger commented on STS-520:
------------------------------------

I don't get offended that easily. ;)  And I disagree with most of what you 
said. HA!  So no offense.

I suppose my biggest problem with using DI API annotations (@Autowired, etc) is 
that you place a dependency on the 3rd party API and its progression, success, 
failure.  Right now there is one reason why Stripes couldn't use @Autowired.  
@Autowired only takes a boolean required attribute.  Stripes checks a method 
for an annotation.  If it is @SpringBean it then looks for a value and if the 
value exists it tries to fine that bean in the Spring context and call that 
method to set the bean.  If no value exists it tries to determine the bean name 
from the method name.  Since @Autowired doesn't support the value string you 
are limited in how you can define your methods.

But what about the future?  What if Stripes decides it needs/wants more options 
available during the injection?  Worse yet, what if Spring changes the 
@Autowired definition?   Example: Spring decides to include a value.  But since 
it already has required it would have to look like this: 
@Autowired(bean="someBean", required=true|false).  At this point, Stripes' API 
has to change.  Its important that Stripes is not dependent on 3rd party API's 
in this regards.  The same scenerio can be applied to Guice as well.  Guice 
changes their annotations and Stripes is back in their code updating to support 
it.

And you can easily add support for multiple DI API's using a single Stripes 
specific annotation.

@Inject(lib="spring | guice")

Or something like that.

> 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

Reply via email to