This is the technical blog of Keyvan Nayyeri, a 29 years old software engineer at Match.Com, speaker and author. You will find content about computer science, programming, and technology on here.
As a part of syllabus for our graduate Software Engineering course, every student is supposed to choose a Software Engineering paper and give a presentation based on it in the class, and answer to questions introduced by other students.
Today it was my turn to give my presentation and I had chosen the famous article by Martin Fowler on Inversion of Control Containers and the Dependency Injection Pattern. The main reason for choosing this paper was that I was very familiar with this article as I had read it before and I had applied the Dependency Injection pattern in many projects.
I had decided to incorporate ASP.NET MVC 2.0 and Ninject to write my examples for this presentation but due to the time limitation and the fact that my audience were not familiar with these technologies, I decided to give a simplified description of the original paper by Martin Fowler. I also had included some funny pictures that I eliminated in the final review because I’d prefer to have more formal presentations rather than funny presentations like those that Scott Hanselman and Phil Haack have!
The presentation begins with a short introduction of the main goal of the discussion and follows by giving a naive example of Inversion of Control to describe the concept. Then it talks about Dependency Injection including its three main styles called Constructor Injection, Setter Injection, and Interface Injection. The presentation also covers Service Locator pattern and some improvements to it like Segregated Interface and Dynamic Service Locator. Finally, the presentation ends with addressing three important comparisons between techniques and concepts covered: Dependency Injection versus Service Locator, Constructor Injection versus Setter Injection, Declarative versus Programmatic Configuration.
I’ve uploaded my slides so you can download them from here.