Dependency Injection Introduction - By Nikhil Pinto

Nov 05 2014
371
0

The goal of this post is to introduce the reader to Dependency Injection (DI). It is a simple introduction to what DI is and looks like. With the help of the below two examples I aim to provide a quick and immediate idea of DI is. The first example is a code sample without any DI implementation. In the second example we have refactored the same code to use DI. The contrasts in these two approaches are explained later and this will help highlight what DI is all about.