Programming and Computing facts by Mohammed Abdulsattar

Thursday, July 30, 2009

ASP.NET MVC Vs ASP.NET Web Forms

Since when Microsoft released ASP.NET MVC in January 27 2009, there has been a lot of debate on this topic — Is ASP.NET MVC better than ASP.NET Webforms? Many developers think that Microsoft has taken a step behind, towards the days of classic ASP, by releasing ASP.NET MVC. But some argue that it will eventually replace Web Forms. But as far as I know, none is true.

ASP.NET MVC uses the Model-View-Controller design pattern and does not use the server controls that Web Forms uses. Many developers were quickly attracted to ASP.NET when it was introduced in 2001 mainly because the Web Forms provided Rapid Application Development ( RAD ). They said that the design was a bit complex and confusing for a newbie but once mastered it’s very easy. ASP.NET MVC removed the much hyped server controls and provided a clean MVC pattern to deal with the UI.

Advantages of Web Forms

  1. Rapid Application Development

  2. Very rich server controls

  3. Easy data binding

  4. Improves over the stateless protocol of HTTP


Advantages of MVC Model

  1. The MVC pattern, by itself!

  2. Separation of Concerns

  3. SEO friendly URLs

  4. Full control over HTML


Disadvantages of Web Forms

  1. The complex design

  2. TheViewstate sometimes reaches large values

  3. Does not generate clean HTML

  4. No separation of concerns


Disadvantages of ASP.NET MVC

  1. Uses the same stateless HTTP

  2. No support for the Server controls that provide the RAD


Which one to choose?

It’s your choice entirely! Choose what is the functionality that you need most, cleaner development or rapid development.

As of me, I’ve chosen ASP.NET MVC. Some of you may be thinking I am wrong because I lose the RAD part. But I’ve a justification for that. I must have lost the famous GridView, but I’d like to tell you that I never liked it! There are many server controls that I’ve never used. I’ve more importantly used the simple ones like <asp:TextBox>, <asp:Label> etc. Making my design more complex and losing my control over the HTML I (ought to) generate is not compensated by those server controls? ASP.NET MVC gives me much better. If you like ASP.NET Web Forms, I’d advise you to shift to ASP.NET MVC and ake a little trouble by yourself and make your customers happy. If you don’t like Web Forms, wait for my tutorial on a simple ASP.NET MVC application! I’ll be posting it soon enough. Till then do some googling for a while and get started.

No comments:

Post a Comment

About Me

My photo
I'm a computer science engineering student with a lot of passion for computers.