Originally published on: 6/29/2008 9:54:19 PM
As a result, the way that viewstate and postbacks work together never felt "natural" to me. I "grew up" with the web being stateless and developed patterns for building applications in that environment. When you suddenly get ASP.NET masking that stateless nature, many of those techniques have to be completely changed.
I have learned to work within that structure, but always wanted something in the ASP.NET ecosystem that was more "webby". I got interested when MonoRail showed up, but for whatever reason, it didn't stick.
Then, earlier this year, I heard about Microsoft's own (horribly clunkily named) project: ASP.NET MVC. After one of the presentations I saw online about it mentioned that it was ASP.NET without viewstate and postback, I was intrigued. That it also implemented (or approximated, depending on your level of pattern religiosity) the MVC pattern closed the deal and I gave it a shot.
The basic idea of MVC and MVC-like approaches to building applications (please save any pedantic discussions of strict compliance for elsewhere) is something I've come to think of as similar to getting food in front of you as a meal. Whether you are talking about a restaurant, your home kitchen or your dorm room, there are 3 basic pieces that map to MVC.
Some of the ingredients are really raw (whole vegetables), while others area fairly processed already, like worcestershire sauce or pre-breaded chicken cutlets. Regardless, they are rarely in a form that you'd eat them 100% unaltered or uncombined.
Eventually, you've got food that's cooked and edible, but either in a pan or sitting on that revolving plate in the microwave: not exactly ready to sit down at a white cloth table or in front of the TV to watch Doctor Who.
When thought of this way, it's clear that the meal and to whom it's being presented can vary how much is going on at each level. For instance, when cooking for myself, I often just dump the food onto a paper plate, even if I use some really good ingredients. Similarly, some meals for guests start with very simple ingredients, but involve a great deal of manipulation and involve elaborate presentation. It all depends.
I've now built enough of it to understand what I did wrong and think I have a better footing for doing more serious apps. It's servicable, though not something I'm itching to share (until I re-do it). However, it made it abundantly clear that, for several personal projects I've got in the hopper, this is going to be my framework of choice.
I actually also chose this project to stretch my legs a bit with Subsonic, another tool I've been watching for the last few months and have to say that the combination is quite enjoyable to build things with.
Things on the ASP.NET MVC front aren't stable at the moment. The current release is "Preview 3" and each of the preview releases has required rewriting bits of apps built on the previous layer. As such, if you've got some personal or internal project (like Jeff Atwood is doing with his stackoverflow.com), it's fun stuff to mess with. By the time it hits its full release, I should be fairly comfortable with it and will be looking to apply it to clients' projects.
And, given the modularity for things like using different view engines, other languages like Ruby, etc. it's something that, if you do any ASP.NET development, you should at least look into and keep an eye on.
There's lots of good content in screencast form that offers a good overview and a decent portal full of content for digging deeper into the topic if you're interested.