Model View Controller Design in ASP.NET

The Model-View-Controller (MVC) design paradigm for Web applications has been around for decades. However, Microsoft is working on a new ASP.NET MVC Framework that will simplify creating Web applications with an MVC architecture. Consider the most common type of Web application — an application which uses a Web interface to access and manipulate data in some backend SQL database. The simplest way to create a Web application is to put everything (display code, logic code, data access code) all into a single .aspx file. But this approach runs into problems as the complexity of the application increases. So, you can use the ASP.NET code-behind mechanism to put the display code in one file and the logic and data access code in a second file. The MVC architecture takes this separation one step farther by separating coe into three files — one with just display code (typically an .aspx file), one with data access code (typically a C# library file), and one with logic code (typically a C# script file). Web developers have been doing this since the release of ASP.NET in 2002 and gain the benefits associated with modularization — easier testing, better reuse, and so on. The only minor problem is that MVC architecture in ASP.NET is currently very loosely defined and Web developers essentially have to design a raw MVC architecture from scratch. Well, Microsoft’s upcoming MVC Framework will provide a more formalized approach. Essentially, the MVC Framework will provide a set of server-side methods which can be accessed by placing declarative tags inside ASP.NET code, similar to the way you can place tags like <asp:button> for user controls. All in all, I don’t think this MVC Framework is a huge revolution in ASP.NET programming but it will be a nice feature for those Web developers who want to use the MVC approach.
This entry was posted in Software Test Automation. Bookmark the permalink.