ASP.NET MVC: Resolve or Inject? Thats the Issue
Posted by: Simple Talk,
on 23 Apr 2012 |
View original | Bookmarked: 0 time(s)
Classes should have dependencies only on abstract, rather then concrete, clesses. To get around this, you can choose between Service Locator and Dependency Injection techniques. ASP.NET MVC uses 'Dependency Resolvers' which are Service Locators. When designing ASP.NET MVC applications it is open to you to decide whether to resolve or inject, so what are the pros and cons? Dino explains....