I have heard of ninject and I have to build a lot of apps that have to integrate with other tools.
SO i was wondering what this was and how it is used.
|
I have heard of ninject and I have to build a lot of apps that have to integrate with other tools. SO i was wondering what this was and how it is used. |
|||||||||||||
|
|
What are dependency Injections :- I will try to help you understand this with examples Without DI Container --
With DI Container -- (Ninject is used in this example)
How often do I use a DI Container? Very often. Close to always. What requirements make me do so? In ASP.NET MVC I always use a container, because when one uses Constructor Injection in Controllers one breaks the default convention of having default constructors. This means that a custom IControllerFactory is required, and while it's possible to write and maintain one by hand, it's more work. Using a DI Container that supports convention-based configuration, one can use Constructor Injection in a convention-based manner and less maintenance is required. Can we do without them? Yes, but at the cost of more maintenance of infrastructure code: http://stackoverflow.com/questions/5667801/arguments-against-inversion-of-control-containers/5668093#5668093 |
|||||||||||
|