chris carter's web log

Home |  Contact |  Admin
 

ASP.NET MVC(Preview 4): Initial Thoughts

Posted on July 30, 2008

Overall

I've spent the last few days exploring the MVC offering from Microsoft.  I like it.  Alot.

Remove everything that sucks about webforms, which is pretty much everything, but more specifically, the page and control lifecycles, and you have ASP.NET MVC. Well, Microsoft MonoRail really.

Brail

I started with the Brail ViewEngine  from the MvcContrib project.  I was impressed with how it was identical in usage as compared to the actual MonoRail flavor.  However, I noted that ViewComponentswere not implemented for whatever reason.  I find them very useful in MonoRail, so I'm not sure they were left out intentionally or not, but after too many yellow screens of death I bailed and went to the out of the box stuff.

Out Of The Box

The out of the box stuff is pretty good.  I don't like the casting that has to take place when requesting things out of the ViewData dictionary.  The runtime should be doing this for us, the Brail ViewEngine does this, the out of the box ViewEngine(what the hell is that called anyway?) should as well.  Maybe that's on the radar for the MVC team.

Source Code

I'm glad they posted the source code.  There some things that were hard to figure out[without documentation], like how to create your own helper class that were difficult without the source code to refererence.  And creating the helper class wasn't the hard part, getting the ViewContext was the hard part(in hind site, not hard at all).

Add New Item

When you add a new item like an MVC View Page, MVC View Content Page, or MVC MVC View User Control, it automatically adds the .aspx(or .ascx) fle, as well as the code behind file and designer file.  This is a little annoying being that I'm not seeing why they're included as they are not needed.  In the .aspx(or .ascx) file, you can set the inherits attribute to either the ViewUserControl or ViewPage, and that's good enough for the ViewEngine.

Html Should Be Simple

 Webforms made html complicated.  ASP.NET MVC is bringing back the simplicity.  If you've ever stepped into System.Web, and viewed the source code for MVC, you'll see a HUGE difference in the amount of code needed to produce simple html.

More to come on MVC...

Comments

Post a Comment

(required)
(required)
(no HTML!)