A Simple IronPython ControllerFactory for ASP.NET MVC

The .NET answer to the wonderful world of web frameworks like Django and Rails is ASP.NET MVC (which reached RC1 in the last couple of days).

There are various ways that dynamic languages can be used with ASP.NET MVC, and the integration is improving. This entry on Code Voyeur demonstrates how to configure controllers with IronPython, using a PyControllerFactory:
The default behavior for ASP.NET MVC is to wire up a controller instance to the controller value found in a request's RouteData. This mapping is desirable for its simplicity, but limited in its ability to provide an extensible configuration model. Managing properties on controllers would likely require either a custom configuration section or extensive use of AppSettings.

An alternative approach would be to use an IoC container, such as Spring.NET. This approach simply manages controller instances as standard Spring container objects. An MVC contrib project already provides support for a Spring Controller factory (among others). This article will present an alternative approach in which controller instances are configured in an IronPython script that lives alongside the MVC application.

Comments

Popular posts from this blog

Extending Abobe Flash Player and AIR with Python and Ruby

Should Python Projects Support IronPython and Jython?

Further Adventures of the Debugger