D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

Why MVC Has Me Concerned

Wednesday, November 14, 2007 5:31 PM
Everyone is talking about the new MVC framework that will be released in the coming weeks as a CTP, and so far everyone is very pumped about the way it will revolutionize web application development...how it will allow us to utilize testing tools, TDD, etc. It's always mentioned with reverence and joy.

Well, hello: my name is Killjoy.

I've read Scott G.'s recent blog entry that gives a great detailed description of how the MVC framework will operate and he walks through a sample app that explains things very well.

The problem I have is that it seems to be a giant leap back for the GUI developer. I mean, maybe with .NET 3.5 and VS.NET 2008, creating web applications with the MVC framework will be a piece of cake compared to what I'm seeing now, which is the resurgence of the <% %> tags from classic ASP days. How will existing .NET interface libraries (like Infragistics) migrate into the new paradigm, and how easy will it be for developers to implement 3rd party controls without the access of  a code-behind to do it in?

These are the questions that bother me a bit...over the next few weeks and months, I'm sure we'll get more info and more examples. But I keep thinking about how many people think that the current implementation of ASP.NET is somehow broken and MVC is going to become the God-send that will lift web development to some new height...which I totally disagree with. I think its great we're getting another choice of framework to develop web applications on, but at the same time we as the web development community need to be pragmatic in how each framework should be utilized. We also need to realize that developing ASP.NET applications the traditional way is not wrong and is in no way lessened by the appearance of the MVC framework.

Instead, I think the MVC framework does illuminate issues that ASP.NET developers have neglected or not bothered to verse themselves with: performance, session/viewstate/cache storage, proper architecture at the UI layer, etc. Maybe this will be the push that Microsoft web developers need to reassess what we need to do to better ourselves in the existing development environment.



# re: Why MVC Has Me Concerned

Okay...a couple of nuggets for you. First, the syntax that will be common (again) with the aspx view engine does suck. It does feel dirty. I can't argue that. But I can argue strongly for the separation of concerns that the MVC model creates.

When talking about the view in the MVC model (this is regardless of if it's the Monorail, MS MVC or other implementation) we're looking at an area that has all of it's data provided to it by the controller. That releases the view to concentrate on the one thing that it needs to....formatting and displaying information to the screen. In the case of a web implementation the view also has some responsibility to call back to the server, but nothing more than that.

You are right about having questions about the use of 3rd party controls. I'm suspecting that many control companies will be creating new controls that can be used without the traditional code-behind model. As it stands using something like the current Infragistics grid control will be fairly difficult.

I 100% agree with your assertion that there may be appropriate places that the traditional aspx development model should be applied over any MVC framework. I will say that, after working with Monorail in the last 4 months, development with an MVC framework makes things a lot easier. My code is way more testable. I'm no longer concerned with some of the nuances of the WebForm processing model.

Do what you have to to get your grubby little mitts on the MS MVC CTP. If you can't do that, take a look at the Monorail framework. Certainly remind me to show you what I've done with Monorail when I'm in the 'Peg in a few weeks. I have a feeling you'll fall a little deeper into lust with web development once you've had a go at MVC. 11/15/2007 3:05 AM | Donald Belcham

# re: Why MVC Has Me Concerned

You're not gonna like my presentation very much man. =) 11/15/2007 3:22 AM | Justice~!

# re: Why MVC Has Me Concerned

Hey buddy,

I didn't get a chance to go into that discussion much last night, but I tend to agree with you.

Personally, I think the MVC framework will be awesome. I came from a Java background before jumping into .Net, and I used Apache Struts quite a lot which is very very similar to the new MVC.

Previous to Microsoft announcing their new MVC, I was actually having a think tank session at home one weekend pondering how to build something exactly like the MVC framework for .Net while still keeping asp.net as a 'view' technology. Luckily now though, I don't have to build it thanks to Microsoft :D

The thing is though, I think asp.net with code behind will still be a great tag team to be used as a view component only, and like you I sure hope they don't try to do away with it.

I think the code behind will still be an essential part of it as you can use it (strictly in a 'view' sense) to take the data that is given to it by the controller, and shape that data for presentational purposes.

I can see situations where you could have a single controller that could be feeding multiple views, each showing similar data and having similar functionality, yet the data displayed and/or functionality exposed in the rendered page is different.

So, I hope I'm saying this the right way. I think there could be situations where the presentation logic could get crazy enough, that angle-percent brackets won't slice the mustard...and a code behind would be very handy and provide an elegant solution for hosting comlex display/presentation logic.

11/15/2007 3:42 AM | Shaneo

# re: Why MVC Has Me Concerned

Another thing I'd like to add. Chances are if Microsoft does do away with the code behind method of creating aspx view pages, they will create a bunch of controls that are less like the standar asp:button, asp:label, etc.. and more like mvc:for-each, mvc:if, you get what I mean. Controls meant to do more of the logic so that less angle/percent brackets are needed

11/15/2007 1:32 PM | Shaneo

# re: Why MVC Has Me Concerned

mvc control statement i.e set, if, for-each would be sweet. i hope this is part of the ctp but somehow i doubt it. ms do say they will integrate with other view engines so we don't have to get lumbered with <% %> syntax, which is a) ugly and b) and real pain to type. in coldfusion they use # #. much nicer. Anyway, mvc is cool. Webforms are cool sometimes but try building accessible sites with em. grrr. Pete 11/20/2007 1:06 AM | Peter

Post a comment