Checking out the NerdDinner code the other day, I found a common Dependency Injection anti-pattern. One of the core concepts of DI is that components are not responsible for locating their own dependencies. The code went part of the way to full-on DI, but not quite far enough. Here’s the offending code:
public class SearchController : Controller {
IDinnerRepository dinnerRepository;
// // Dependency Injection enabled constructors
public SearchController() : th...
No comments yet, be the first one to post comment.