Chinmaya Dash
ASP.NET MVC 4 Dependency Injection?
By Chinmaya Dash in .NET on Aug 30 2016
  • Chinmaya Dash
    Aug, 2016 30

    In real life application development, you will see almost all ASP.NET MVC applications are needed to inject its dependent component. You can create component directly inside the controller instead of inject them. In that case the controller will be strongly coupled on those components. If any component's implementation is changed or new version of that component is released then you must change controller class itself.Another problem you will face when you will write unit test. You cannot run unit tests of those controllers independently (within isolation). You cannot take mocking features from unit testing framework. Without mocking, you cannot run unit test of your code in a isolated environment.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS