Twelve Best Practices For Spring XML Configurations
Subject:   I'm sorry...
Date:   2006-02-01 16:02:16
From:   jhannes
Response to: Autowiring

... but that is just dumb. :-)

I think everyone agrees that you shouldn't use autowire when Spring will throw an exception! But would you ever do that anyway?

When autowiring would be ambigous, you cannot use it, so there is really no point in recommending against autowiring - it ain't an option!

Now: Is it really a good thing that both you DAO and your proxy are available for autowiring? You DAO shouldn't be visible at all! Use an inner bean definition or an autoproxy thingie, and your problem will go away.

Regarding autowire by name: When you can be consistent, that is not a problem, but a solution.