This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Constructor injection is good when you want to force the caller to pass something and not default.
In practice, I tend to use a mix of the two. I use setter injection mainly when:
- Injecting more than one thing
- I don't control the constructor
- I'm only injecting for testing and the "real code" doesn't need to inject.