Thursday, August 10, 2006

Use of MVC pattern in ASP.NET Web Appications

Something that I have come across on all ASP.NET projects I have seen is the lack of use of the MVC pattern. Rather the code-behind for each page acts as a kind of front controller. But in applications with complicated flows I recommend against putting controller logic in the code-behind of each page, since it makes it difficult to see how the control flows through the application.

If you want to use MVC style of programming there are some alternatives out there:

- The "User Interface Process Application Block" provided by Microsoft.
- The .NET version of het Maverick MVC framework

I also think that the new Windows Workflow Foundation can be used to implement MVC solutions.

I think that many .NET developers would see the benefits of MVC style programming by checking out one of the many frameworks available for java, even though most of them are not without their problems.