Wednesday, March 12, 2008

ASP.NET MVC vs. WCSF

I've been thinking about the best way of building enterprise web applications after creating few sample applications with both ASP.NET MVC framework and WCSF and if I was to look at from a holistic perspective, both the frameworks provide excellent separation of concerns thus enhancing the modularity and testability of the application yet there are differences in their approaches.

ASP.NET MVC provides a new ground-up framework for building web applications that doesn't uses the core ASP.NET framework concepts like PostBacks, ViewState, Code Behind etc. It really enforces the discipline of creating simiplistic views, which are dependent on a controller to handle user events and pass the model to it. It forces one to think of Views as a pure rendering mechanism and doesn't allow the developer to pollute the .aspx files with all the gobbledygook of interactions with services to build a page. It provides a very clean way of handling all the HTTP verbs and provides a pluggable architecture to inject components to handle those requests. All the HTTP calls are routed to a controller which decides the action i.e. method to invoke, gets the right model and passes it to View to render the data. One can build very clean REST based solutions by using ASP.NET MVC framework. To learn more about the framework, I would recommend reading Scott Guthrie's blog and viewing these videos.

WCSF on the other hand builds uses the existing ASP.NET Forms based framework and provides a pattern based approach of building applications. It has guidance bundles which provides the right solution and project structure, code generation recipes, out of the box integration with various application blocks like Security, Exception Handling and Logging. It also provides good separation of concerns by following the MVP design pattern. Thus, a developer doesn't have to learn new patterns of building web applications and can utilize all the core concepts of PostBack,ViewState etc. and on top of it is given pre-configured access to the Logging, Exception Handling and Authorization features.

IMHO, WCSF is a better option if one was looking at capitalizing on ASP.NET strengths and, standardizing web development practices. ASP.NET MVC framework provides utmost flexbiity in creating web solutions but it's a 180 degree change in the way we have been building ASP.NET web applications and I'm not even sure how would it pan out while building enteprise applications. In the coming days, I would publish a detailed comparison of both the technologies.

4 comments:

Sajay said...

I'm guessing you have already gone through the URI template and Restful services guidances :) ..
But a good comparion and probably can augment WscF greatly.

Sajay said...

You have to play with the new WF bits just for a good time pass. I'm really playing with the WCF runtime now and trying to talk with teams on scalability for workflow.

Btw i'm moving from msdn to http://sajay.com (all data migrated as well)

John Caruso said...

Tarun,

Hey, it's John Caruso. Just stumbled on to your blog from LinkedIn. Are you ever going to do that comparison of MVC vs WCSF? I'd be very interested in reading it and hearing your thoughts!

Take care,

John

Tarun Kohli said...

John,
Apologize about not being active and not posting the comparison about both the technologies. I started researching into these frameworks but ended up getting swamped with a a travel e-commerce portal.

I would have to pick up the pieces again to figure out the differences :)