What is constructor injection?

Posted by TheSilverBullet on Programmers See other posts from Programmers or by TheSilverBullet
Published on 2012-11-29T10:34:20Z Indexed on 2012/12/10 17:29 UTC
Read the original article Hit count: 348

Filed under:
|

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.

© Programmers or respective owner

Related posts about c#

Related posts about dependency-injection