What are the pros and cons of using @Autowired in a class that will be wired up by Spring?
Just to clarify, I\'m talking specifically about the
For me here is what I like/dislike about Spring and auto-wiring.
Pros:
Cons:
I've started using auto-wiring almost exclusively at work because we depend so much on Spring integration anyway that the dependency issue is moot. I worked on a Spring MVC project that used auto-wiring extensively and was a little hard to wrap my head around.
I think auto-wiring is an acquired taste, once you get used to it you realize how powerful, easy, and much less of a headache it is to work with than the XML configuration.