Framework Madness!

And other adventures C# and asp.net …

Asp.net MVC – Why?

leave a comment »

I have been using ASP.net Web Forms since the 1.0 Beta 2 release in late 2001.  At the time of it’s release ASP.net as a whole eclipsed ASP classic in many ways. But like any technology its was designed to solve the technology of it’s time. However, in recent years many of these solutions that Web Forms solves are no longer problems, and quite often today much of what comprises Web Forms and it’s elaborate control architecture seems … unnecessary. Since ASP.net is really just making the .Net framework available for web page creation many of the functional decisions can be traced to browsers of the day. So what was that environment?

  • IE 5/5.5, IE 5 for Mac, and Netscape for 4.x all had a very different support for html layout and css styling. ASP.net’s controls could adapt html css style output depending on what kind of browser was making the request. This would often result much different html and css being sent to the various browsers, depending on the control in question.
  • The XmlHttpRequest object, the X in AJAX, existed primarily in IE for Windows at the time. ASP.net therefore requires full page post backs, but with the existence of control model that emulated state – that allowed for only one form per page and elaborate sever side control pipeline. If you have ever tried to write an elaborate server control you know.
  • The JavaScript environments varied wildly between the browsers, so ASP.net aimed squarely at a creating a pseudo event-driven environment on the server that would allow for a more consistent programming environment. And sure – some control such as validators supported JavaScript in IE, but ASP.net would transparently run the same code on the server if the browser requesting the page didn’t measure up.

So it was a big win for lots of us developers, upcoming and established alike. That was 2000-2001.

Flash forward six or seven years later and all of the scenarios above can be easily handled by all major browsers on Windows, Mac and Linux either by the browser alone or with the assistance of JavaScript libraries. The success of the .net framework and ASP.net have brought in a bucket load of developers that find .net Framework to be powerful but ASP.net engineered. And those of us that have persisted have learned that simpler is almost always better, test if you want to make a living, and you should only have to write your code once. ASP.net Web Forms wasn’t really engineered for these concerns, so the case for adopting Model-View-Controller as an alternative web platform within ASP.net was born.

Advertisements

Written by Lynn Eriksen

June 22, 2009 at 10:22 pm

Posted in Uncategorized

Tagged with ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: