The REST-Like Aspect Of ASP.NET MVC

While at DevConnections/OpenForce, I had some great conversations with various people on the topic of ASP.NET MVC. While many expressed their excitement about the framework and asked when they could see the bits (soon, I promise), there were several who had mixed feelings about it. I relish these conversations because it helps highlight the areas in which we need to put more work in and helps me become a better communicator about it.

One thing I’ve noticed is that most of my conversations focused too much on the MVC part of the equation. Dino Esposito (who I met very briefly), wrote an insightful post pointing out that it isn’t the MVC part of the framework that is most compelling:

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.

In describing the framework, I’ve tended to focus on the MVC part of it and the benefits in separation of concerns and testability. However, others have pointed out that by keeping the UI thin, a good developer could do all these things without MVC. So what's the benefit of the MVC framework?

I agree, yet I still think that MVC provides even greater support for Test Driven Development than before both in substance and in style, so even in that regard, there’s a benefit. I need to elaborate on this point, but I’ll save that for another time.

But MVC is not the only benefit of the MVC framework. I think the REST-like nature is a big selling point. Naturally, the next question is, well why should I care about that?

Fair question. Many developers won’t care and perhaps shouldn’t. In those cases, this framework might not be a good fit. Some developers do care and desire a more REST-like approach. In this case, I think the MVC framework will be a good fit.

This is not a satisfying answer, I know. In a future post, I hope to answer that question better. In what situations should developers care about REST and in which situations, should they not? For now, I really should get some sleep. Over and out.

Technorati Tags: ,

What others have said

Requesting Gravatar... Jason Haley Nov 10, 2007 12:55 AM
# Interesting Finds: November 10, 2007
Requesting Gravatar... Scott Bellware Nov 10, 2007 9:30 AM
# re: The REST-Like Aspect Of ASP.NET MVC
With all due respect to Dino for his extensive experience in web development on many platforms, I think that it's a step in the wrong direction to start the REST-is-the-main-apsect-of-the-framework conversations before the framework is even ready for public consumption, let alone ready for use in production CLR web apps, where it will generate real, actionable heuristic feedback.

If the ASP .NET MVC framework delivers a web developer experience on the order of the Rails experience, then it's success will be traceable to the developer community's understanding that the power comes from recognizing the value of all of the framework's subsystems, and the knowledge and perspective that allows individual developers to wield all of the framework's aspects simultaneously with equal ability.

We get the most out of frameworks like Rails - and hopefully ASP .NET MVC - by harvesting the emergent value that comes from adeptly unifying the framework's various aspect into a single charge into a web app's problem domain.
Requesting Gravatar... Work vs. Play Nov 10, 2007 11:02 AM
# Back from DevConnections
I spent last week in Las Vegas at the DevConnections conference. It was my first BIG conference, although
Requesting Gravatar... Christopher Steen Nov 10, 2007 1:17 PM
# Link Listing - November 10, 2007
ASP.NET The REST-Like Aspect Of ASP.NET MVC [Via: Haacked ] WPF Routed Event Viewer [Via: Karl Shifflett...
Requesting Gravatar... Christopher Steen Nov 10, 2007 1:17 PM
# Link Listing - November 10, 2007
Link Listing - November 10, 2007
Requesting Gravatar... Eyad Salamin Nov 10, 2007 2:02 PM
# re: The REST-Like Aspect Of ASP.NET MVC
by keeping the UI thin, a good developer could do all these things without MVC. So what's the benefit of the MVC framework? I agree

Well, this is true, but..
I believe one of the main characteristics of a framework is to force the developers to follow a set of design patterns (for instance: MVC) which results in easily maintainable and consistent applications.
A good developer usually writes clean code, on the other hand, a good framework forces even average developers to write clean.
Requesting Gravatar... rajiv das Nov 10, 2007 3:41 PM
# re: The REST-Like Aspect Of ASP.NET MVC
Personally I like to get asp.net +
1. Freedom from viewstate
2. freedom from having to decide which event to hookup to.
3. freedom from postbacks breaking history (ajax solves this)
4. neat urls
5. good css output from web controls

whether its asp.net mvc or nething, who cares? give us this.
Requesting Gravatar... Wiryadi Nov 10, 2007 8:35 PM
# re: The REST-Like Aspect Of ASP.NET MVC
I hope ASP.NET MVC framework keep focusing on delivering the best MVC framework. If you try to satisfy all parties, you'll end up with mediocre product that does not satisfy everybody.
Requesting Gravatar... Howard van Rooijen Nov 11, 2007 5:07 PM
# re: The REST-Like Aspect Of ASP.NET MVC
Hi,

has there been any public communication why MVC was chosen as the pattern rather then MVP or Presenter First - http://atomicobject.com/pages/Presenter+First ?

Thanks!
Requesting Gravatar... secretGeek Nov 11, 2007 8:26 PM
# re: The REST-Like Aspect Of ASP.NET MVC
when i read the title i thought you were going to write about Astoria....

what's your opinion there? is there some rest overlap between astoria and MVC? any re-use opportunities internally?
Requesting Gravatar... f baldoni Nov 11, 2007 9:55 PM
# re: The REST-Like Aspect Of ASP.NET MVC
Sorry Phil, but I got no value from your blog post. If you have to bend over backwards to explain why something like MVC or REST is such a great idea then chances are it's probably not that great. I'm still willing to listen, but please respect peoples time by posting things of substance.
Requesting Gravatar... Jeff Nov 12, 2007 4:42 AM
# re: The REST-Like Aspect Of ASP.NET MVC
Another point of interest is that an ASP.NET MVC framework was demanded by a very loud and vocal minority that does not represent the whole asp.net community: ayende, connery guy, the codebetter.com bloggers, etc.

Nearly all of that genre are consultants...the MVC Rails-like framework fits there requirements: fast, easy development, etc. They can pick and chose the projects they want to work on, so when integration with legacy systems is not a concern this model fits.

One thing I have read over and over is that the webforms model is too complex, etc, etc: "A Leaky Abstraction". I think is its rather simple myself and even elegant. I have seen a lot of developers who abuse Page_Load and use it as a continuous block or procedural code...but that is not a flaw in the design, but in the developers. I mean if they can abuse Page_Load, I am sure they will abuse (if they even understand) an MVC pattern.

However sick and tired I am of listening to the MVC/Rails punch, drunk blogger/consultants that are pushing this framework, I'll be sure to use it in a fitting project ASAP. Not because I feel that its better than the traditional webforms model, but because I now have no choice: in this profession its learn or die...

Requesting Gravatar... Scott Nov 12, 2007 7:05 AM
# re: The REST-Like Aspect Of ASP.NET MVC
Jeff,

I haven't seen the actual bits Phil et al... is working on. But from what I've seen in demos, they've built the MVC framework on the same basic System.Web framework that WebForms is based on, but it doesn't interfere with WebForms at all.

ObfuscatedNerd, ;)

I think Astoria is an excellent fit for this MVC framework. I'd also like to see how the Dream REST server from Mindtouch could be used in the MVC model. It could provide some interesting uses in distributed, high-scaling applications.
Requesting Gravatar... Haacked Nov 12, 2007 3:53 PM
# re: The REST-Like Aspect Of ASP.NET MVC
@f baldoni - I assure you, no backward bending required. I'm sorry you got no value from my post. I got the same amount of value from your comment.

@Jeff - ASP.NET MVC will *not* replace WebForms + PostBack. It's an alternative means of building a web app.

@Scott - I'm still getting more familiar with Astoria to better understand how it fits with MVC. My understanding is that it provides a fast way to get data via RESTful queries.
Requesting Gravatar... Jeff Nov 13, 2007 3:49 AM
# re: The REST-Like Aspect Of ASP.NET MVC
Yeah, I think my post gave the wrong impression: that I am _so_ punch drunk in love with webforms, that no possible alternative exist. I guess It was more reaction to division within the community that seems to be occuring where either your are ecstatic about the rails/mvc approach and the rest who don't see it.


The inner geek is excited that there are alternatives, and is seething for the bits. The realist (perceived, of course) in me says that that its going to have limited application outside of new development and/or relatively simple web applications.

I guess my concerns are rooted in the fact that it reminds of the classic asp mvc-like pattern of changing the view based upon the request and all of the crappy procedural code I saw. HTML vomit being added to the response stream and such...

I would like to see how well it works with RIA: ajax and silverlight (1.1) applications.
Requesting Gravatar... ecossaise Nov 13, 2007 8:39 AM
# re: The REST-Like Aspect Of ASP.NET MVC
-- Jeff
> ayende, connery guy, the codebetter.com bloggers, etc.
> Nearly all of that genre are consultants
> ...
> I now have no choice: in this profession its learn or die

Dude, you're implying you aren't a despicable--I know you didn't say so, you only thought so--consultant. Hence, I surmise you have a cushy job with long coffee breaks, long hours browsing the web on company time, and no pressure to learn new things. Web forms aren't going away. You have the enviable luxury of churning out viewstates until you retire or until Microsoft retires the .Net Framework.
Requesting Gravatar... Jeff Nov 13, 2007 9:24 AM
# re: The REST-Like Aspect Of ASP.NET MVC
--ecossaise

Hehe, point taken. You are wrong in your surmise, however...off by a long shot.
Requesting Gravatar... Community Blogs Nov 14, 2007 10:01 AM
# MVC, REST, and the Alternative ASP.NET Framework
Phil and Dino Esposito have been talking about the RESTful aspects of the upcoming ASP.NET MVC framework
Requesting Gravatar... Rob Zelt - Lighting Up The Web Nov 21, 2007 9:51 AM
# I Want My MVC
Requesting Gravatar... Ranko Dec 18, 2007 6:01 PM
# First Thoughts On MVC.NET
Finally some time for .net. Since Scott and Phil started writing about is I wanted to read and try out
Requesting Gravatar... Piers Jan 20, 2009 6:40 AM
# re: The REST-Like Aspect Of ASP.NET MVC
I've tried to take those RESTful like aspects and turn them into a full blown RESTful web service on my blog:

http://shouldersofgiants.co.uk/Blog

What do you have to say?

(will show your gravatar)
Please add 1 and 1 and type the answer here: