DevConn07 Fall:: MVC FX is it car or motorcycle?

Published 07 November 07 12:42 AM | despos

The MVC Framework is the next (not necessarily big) thing for ASP.NET developers. ScottGu unveiled some of its aspects a few weeks ago. Today here at DevConnections I attended a presentation about this new stuff. First off, the "new stuff" is really new and for the time being we're not allowed yet to play with it. No CTP is available at this time and no sample code is available for home perusal.

This is reasonable because we're clearly talking about a technology that is not even in alpha. But the funny thing is that we're here talking about it :)

<grin>
It seems that the bar of software preview has been moved one more tick down. There was a time when any software was top secret until publicly released. Next, we assisted to pre-release announcements and demos. Next, we were allowed to play ourselves with beta versions for longer and longer times. And our feedback was first appreciated and then requested. Next, it was the season of CTPs, progressive alpha versions that precede the beta stage--the teen-age of software.
With the MVC framework we reached the notable point of publicly discussing a piece of software that is not even a CTP. I wonder what would be the next step. Discussing ideas, I bet. And after that?
</grin> 

So the ASP.NET MVC framework. I totally agree with one of the sentences in the intro slide. The MVC framework is not Web Forms 4.0 but is simply an alternative to it. Like with cars and motorcycles, each has pros and cons, and everyone can find it simple or complex based on his/her preferences and attitudes. The MVC framework blinks at the Model-View-Controller pattern and apparently transmits the idea that just the MVC pattern represents its main aspect. But wait a moment. I just said that the MVC framework represents an alternative to Web Forms. Which is largely true and correct. And then? If the MVC framework is all about the MVC pattern, does it mean that the MVC pattern represents an alternative to Web Forms? Put this way, we're simply comparing apples and oranges.

So what's IMHO the main aspect of the MVC framework? It uses a REST-like approach to ASP.NET Web development. It implements each request to the Web server as an HTTP call to something that can be logically described as a "remote service endpoint". The target URL contains all that is needed to identify the controller that will process the request up to generating the response--whatever response format you need. I see more REST than MVC in this model. And, more importantly, REST is a more appropriate pattern to describe what pages created with the MVC framework actually do.

Is there any MVC in it? Sure, there is. The team just used the MVC pattern to implement a framework that adds REST capabilities to the ASP.NET platform. With this new framework you don't need the viewstate to save the last-known-good-state of each page and the postback model with all of its events is gone. Why? There's just another HTTP handler to serve the request and this new handler just figures out which action to carry out, grab data (the model), calls the appropriate method (on something called the controller), collects its output and prepares the response--called the new view. In my opinion, the MVC pattern is instrumental to implementing an alternative model for Web requests.

In this context, MVC is like XML in AJAX. It's neither the main actor nor the main factor. But it's in the name of the technology because, perhaps, it makes it cool. As I'll be explaining tomorrow MVC or MVP (Model-View-Presenter) can be applied to ASP.NET pages regardless of the model they use for posting back to the server.

Your take?

 

 

Filed under:

Comments

# Dino Esposito said on November 6, 2007 07:42 PM:

Professione speaker (a Las Vegas)

# Buy a Car » DevConn07 Fall:: MVC FX is it car or motorcycle? said on November 6, 2007 09:07 PM:

Pingback from  Buy a Car &raquo; DevConn07 Fall:: MVC FX is it car or motorcycle?

# Sonata Reviews from the Net » DevConn07 Fall:: MVC FX is it car or motorcycle? said on November 6, 2007 09:44 PM:

Pingback from  Sonata Reviews from the Net &raquo; DevConn07 Fall:: MVC FX is it car or motorcycle?

# 800 NOTES » DevConn07 Fall:: MVC FX is it car or motorcycle? said on November 6, 2007 09:46 PM:

Pingback from  800 NOTES &raquo; DevConn07 Fall:: MVC FX is it car or motorcycle?

# Jeff G. said on November 6, 2007 10:56 PM:

My take is that MVC is not needed in ASP.NET because the framework provides everything needed to separate your presentation / business logic / data. For instance, a "user control" or "custom control" can be re-used as a flexible "view" for your data. The model can be extracted out into a Business Logic Layer (perhaps with an ORM such as LLBLGen). And further use of custom classes provide re-use throughout the application. Everything is there to prevent code duplication. Viewstate is great. It really simplifies things but does require a good understanding of how it works. ASP.NET is starting to take too many directions. It works great as is. Don't fix it if it ain't broke.

# Cars and other stuff » Blog Archive » DevConn07 Fall:: MVC FX is it car or motorcycle? said on November 6, 2007 11:21 PM:

Pingback from  Cars and other stuff  &raquo; Blog Archive   &raquo; DevConn07 Fall:: MVC FX is it car or motorcycle?

# DevConn07 Fall:: MVC FX is it car or motorcycle? — All About Hyundais said on November 6, 2007 11:35 PM:

Pingback from  DevConn07 Fall:: MVC FX is it car or motorcycle? &#8212; All About Hyundais

# David Taylor said on November 7, 2007 04:06 AM:

It might bring in a few Java developers?  MVC has been used throughout most java presentation frameworks for the last 10 years...

# Alien said on November 7, 2007 06:20 AM:

Is it just me or developers really misuse the MVC/MVP patterns? I've seen a couple of implementations in asp.net applications and literally none of the MVP pattern usages was justified IMO. The MVP guys usually speak about better testability, decoupling, blah, blah... But I can do the same with the common 3-layer approach (as Jeff G. mentioned here), so where's the benefit?

Furthermore, with the layered approach it's more decoupled - I don't need a view-aware presenter (the observer pattern); I can simply subscribe to an event of a business-process component and the BP component doesn't have to know about the view. (event-driven approach is todays implementation of the observer pattern, in my understanding).

# AndrewSeven said on November 7, 2007 08:43 AM:

Its not just MVC, it is a very specific style of MVC.

Web Forms with Business Object, Markup, and Code Behind can be MVC too.

# Scott Hanselman said on November 7, 2007 08:37 PM:

Sample code and CTP bits are coming literally ASAP. I'm glad you enjoyed the talk.

# Ran Davidovitz said on November 7, 2007 08:41 PM:

Dino we are on the same mind :), see my blog.

# Alien said on November 8, 2007 05:13 AM:

to AndrewSeven: fair enough. My comment was slightly off topic. I'm not complaining about the MVC framework itself (i can't complain as nobody has really seen it yet ;)

It's just sigh about people asking for MVC/P in ASP.NET. IMHO they're trying to overcomplicate it. I'd be curious where all the people come from - is it from java world?

In my understanding, ASP.NET MVC framework is a brand new approach (mix of a couple of patterns) and it's MVC just by name. Let's see what they will come up with.

# Byron Walker said on November 8, 2007 06:36 AM:

Most of you guys dont practice TDD do you? What about interface based programming?

After a decent period of time practising these things you start to see the flaws in the current ASP.NET postback/page lifecycle model.

The MVC framework doesn't over-complicate things, it simplifies them. Rails anyone?

# Dmitry Lyalin said on November 9, 2007 03:38 PM:

The problem is that with every new approach, pattern or technology provided there will be 50 people that use it okay, 5 people that use it really well and 100 people that will leave you confused and dumbfounded if your one of the other 55.

At the end of the day i love having options as long as i can ignore that which i dont need or care to use. GUI and abstraction is everything.

Overall MVC is a good concept, but i will not comment on this until i see the CTP. I am sure that Scott and the team have good intentions. The one thing i dont look forward to is selling "yet another new thing" to my boss if it turns out to be awesome :).

# Ran Davidovitz said on November 10, 2007 12:44 AM:

I personally think that the team will need to allow using the MVC with a regular postback / viewstate based request (thus creating a new mapping layer) so that people will be able to use this technology without losing all their current skills and even controls they created or bought.

As i wrote in my blog i think that the current implementation will cause people that want to create a real life scenario application a real pain

Now don't get me wrong, I like the solution but i just think it need some tweaks.

A suggestions to Scott and Phil (the team), involve the community as it has lots to offer (and at the end use :))

Your take ?

# you've been HAACKED said on November 10, 2007 04:54 AM:

The REST-Like Aspect Of ASP.NET MVC

# BusinessRx Reading List said on November 11, 2007 09:37 PM:

Phil and Dino Esposito have been talking about the RESTful aspects of the upcoming ASP.NET MVC framework.

# alien said on November 12, 2007 07:33 AM:

to Byron Walker: i use TDD. My point was that you can do TDD with 3-layers without MVC. If you don't write business code in page code behind (everything is in business components), everything is easy to test for (except for pure UI code - disable/enable buttons if ... - i usually don't write tests for this).

I agree though that the current asp.net postback model has some flaws - that could be probably improved by changing the overall design.

# Community Blogs said on November 14, 2007 09:01 PM:

Phil and Dino Esposito have been talking about the RESTful aspects of the upcoming ASP.NET MVC framework

# DotNetKicks.com said on November 16, 2007 05:51 AM:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# Brad Williams said on November 20, 2007 12:57 PM:

Dino, thanks for clarifying this in your MVP talk, it really helped me make more sense of MVC FX than did the Microsoft talk.  You are right that MVC/MVP can be done in traditional ASP.NET framework, that is what my team does.

Leave a Comment

(required) 
(required) 
(optional)
(required)