2. If you are new to DI Click here to view
Dependency Injection for Beginners
And then come back!
If link will not work you can copy and paste following url:
http://www.slideshare.net/bhushanmulmule/dependency-injection-for-beginners-31272832
3. Let us create sample ASP.NET MVC
application to see DI in action
We will be using
ASP.NET MVC Application
To Demonstrate NInject
Follow the Walkthrough to create one
55. Client Request
for index
method of
HomeController
type HomeController
MVC
Ninject
Dependecy
Resolver
type HomeController
Ninject
56.
57. Client Request
for index
method of
HomeController
type HomeController
MVC
Ninject
Dependecy
Resolver
type HomeController
Ninject
Inspects
constructor of
HomeController
for dependencies
58. Note: Here Ninject will create object of EmailNotification as we have
bounded it to INotification in AddBinding() method. Same way it can be
bounded to SMSNotification.
59.
60.
61.
62. Client Request
for index
method of
HomeController
type HomeController
MVC
Object HomeController
with
Object EmailNotification
Ninject
Dependecy
Resolver
type HomeController
Ninject
Object HomeController
With
Object EmailNotification
Inspects
constructor of
HomeController
for dependencies