Chapter 11

Dependency Injection

— By Brad Wilson

What's In This Chapter?

  • All about software design patterns
  • How to use the dependency resolver

ASP.NET MVC 3 has introduced a new concept called a dependency resolver, which dramatically improves the ability of an application to participate in dependency injection for both services consumed by MVC and commonly created classes like controllers and view pages.

To understand how the dependency resolver works, we first need to define some of the common software patterns that it uses. If you're already familiar with patterns like service location and dependency injection, you may want to skim or skip the next section and go directly to the section titled “Using the Dependency Resolver.”

Get Professional ASP.NET MVC 3 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.