What is constructor injection?
- by TheSilverBullet
I have been looking at the terms constructor injection and dependency injection while going through articles on (Service locator) design patterns.
When I googled about constructor injection, I got unclear results, which prompted me to check in here.
What is constructor injection? Is this a specific type of dependency injection? A canonical example would be a great help!
Edit
Revisiting this questions after a gap of a week, I can see how lost I was... Just in case anyone else pops in here, I will update the question body with a little learning of mine. Please do feel free to comment/correct.
Constructor injection and property injection are two types of Dependency Injection.