O'Reilly logo

ASP.NET MVC 2 in Action by Matthew Hinze, Eric Hexter, Jimmy Bogard, Ben Scheirman, Jeffrey Palermo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Controller factories

This chapter covers

  • Building custom controller factories
  • Dependency injection with controllers
  • Working with StructureMap
  • Working with Ninject
  • Working with Castle Windsor

One common technique when building applications is to pass application dependencies into the constructor of the controllers. By leveraging various tools, we can automatically wire up these dependencies and provide the arguments without having to write mundane, repetitive code.

To enable this for our controllers, we need to take responsibility for creating them. In this chapter, you’ll learn about controller factories and how you can use them to help enable such scenarios.

13.1. What are controller factories?

Controller factories are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required