The Freak Parade

Strange noises from the mind of Nathan Stults…
  • rss
  • Home
  • About The Freak Parade

To (ASP.NET)MVC or not to MVC (or, ASP.NET MVC Hyperlink Acupuncture)

July 29, 2008

Currently, we are struggling with a decision as we stand at the edge of a new project and attempt to divine the future. Here are a few chicken bones, in the form of links:

Jeff Atwood is working with MVC, and is bothered by what he feels is the re-introduction of Tag Soup. Rob Conery begs to differ, and makes the case that if you are careful and organized you can easily avoid Tag Soup, and instead prepare a delicious Tag Cobbler. In the comments, readers suggest you can do Tag Cobbler one better and have yourself a nice, orderly, maintainable Tag Cake with some of the alternate view engine integrations provided in the MvcContrib project. (Or, maybe you like SharpTemplate.NET for its flexibility, but are dismayed that there is no default MVC integration in MvcContrib. Don’t worry, it is trivial to create the integration yourself.)

One of the most significant concerns with leaving your old ASP.NET station wagon running at a red light and jumping into the sexy new MVC convertible with  image imagethe hot blonde making eyes at you from the turning lane is the lack of rich UI controls for MVC. Classic ASP.NET may have drawbacks, of course, but one of its great strengths is the breadth of very well made user interface components to turn your ugly developer sensibilities into a beautiful and modern masterpiece in a plug n’ play way. We use Telerik controls here, but they aren’t ready to commit to an MVC suite yet. There is some advice on how to use user controls in ASP.NET MVC (and other ways to gracefully render content in MVC), but it will likely take some time before rich UI components are available for MVC, the framework is just so different. In the mean time you can make some third party controls work with MVC if they will function without postbacks or viewstate, and there is no particular reason your MVC application can’t link to a standard ASPX page with a full lifecycle if you only have a few places where you need some particularly web forms dependant control.

Another approach to server controls, though, is DHTML controls. There are a number of vendors and open source frameworks that provide rich grids, tree views, etc. purely using JavaScript and AJAX. These should work just fine with MVC without modifications. However, this won’t cover all your bases. For instance, I haven’t had much luck finding a Javascript calendaring / scheduling suite that can even come close to the server-control based Telerik or DevExpress offerings.

If you choose ASP.NET MVC

If you want to use jQuery to facilitate your AJAXiness, check out this blog post and associated download. And this one and subscribe to this blog. If you want to use jQuery for validation using MVC, read this. You may also want model-based validation that works server side AND client side. Here is a post providing links to both client side and server side validation techniques.

If you end up using the excellent extJS suite of JavaScript controls, you should check out Coolite, which wraps the extJS library with ASP.NET controls and will have MVC support shortly, and the project extsharp that uses Script#, a library that allows you to compile C# into JavaScript, to product a C# object model for working with extJS controls.

You will also want to check out the S#arp Architecture project on CodePlex by Billy McCafferty. This is a reference architecture for building an enterprise ASP.NET MVC application in a modern, domain driven style using NHibernate 2.0 as the ORM and dependency injection via Castle Windsor. I’m still in the process of going through the documentation, but this looks like a really solid place to start if you’re building an app from scratch. If you go the NHibernate route, take a look at this series of posts about using NHibernate, ASP.NET MVC, and Rhino Commons.

You’ll also want to follow the excellent blogs of Stephen Walther, Scott Guthrie,  Jeffrey Palermo (who is writing a book for Manning on ASP.NET MVC, which you can read as its written via their
Early Access Program) and Rob Conery (who has produced quite the library of screencasts on building an ASP.NET MVC application using TDD). Oh, and Maarten Balliauw seems to have consistently high quality posts on MVC as well. He even came up with a nifty MVC Extension method to render a Data Grid with paging and editing capabilities using an extension method. Pretty slick.

ASP.NET MVC Lives Here, with helpful relatives in the granny unit, and has a summer home here.

[Update] There is an ASP.NET MVC “News, Announcements and Information”, aka buzz site, here at aspdotnetmvc.com that acts as a sort of giant ear to the ground picking up and aggregating any and all things MVC that pop up on the web. I don’t think it is just a dumb aggregator, though, I think it is human-filtered, so it is probably a good place to visit frequently or a good starting point for MVC research. I tried subscribing to the RSS feed once, but was almost immediately blown out of my seat by volume of aggregated posts, so I un-subscribed. But if you’re working with ASP.NET MVC, I’m pretty sure you’ll want this site on your short list of bookmarks, or, if you can withstand the torrent, you might even want to subscribe.

Want to create some services using MVC? Read this and this.

Want to create reusable controls for MVC? Read this and this.

Want to add HTTPS/SSL support to ASP.NET MVC routing? Here it is.

Want to run an ASP.NET MVC using an embedded web server as a desktop app? No? I don’t believe you. Read this.

For good measure, also check out this Digg clone built using ASP.NET MVC. They call it Kigg, so that you can’t say it out loud without feeling silly.

Steven Walther is building the self proclaimed Best Forum Application IN THE WORLD based on MVC. This is an ongoing series, currently at post 4 1/2. See
Part 1, Part 2, Part 3 , Part 4 and Part 4/12. In addition to technical MVC discussion, the series opens up with a very nice, ALT.NETy discussion of the the best way (from a process / practice point of view) to go about building the best forum app in the world.

You’ll probably also want to check out BlogSvc.net, and open source Blog Engine built using ASP.NET MVC. This is not a sample app but a full blown blogging platform that is built on AtomPub and uses LINQ, jQuery and other cool technology. The project website is here and the Codeplex home page is here.

More recently, Maarten Balliauw has posted another end to end sample called Car Trakkr, which is built on the Beta 1 release, so it’s nice and fresh.

 

If you stick with ASP.NET Web Forms

But you covet the pretty little .aspx-less URLs of MVC, read this.

Web Forms and MVC are not the only patterns on the block, BTW

Don’t forget about MVP. Many people prefer MVP (Model View Presenter) over MVC, and while the frothy, drunken buzz over ASP.NET MVC is rather deafening, there is a lot of support for doing MVP in ASP.NET, numerous open source frameworks supporting it, and it might be a good middle ground between the two approaches. If you’re going to use DDD and NHibernate and are interested in MVP, read this article and check out the “Enterprise Sample” that is included. Also by the same author (and the author of S#arp Architecture noted above) is this Code Project article and associated samples about building an MVP app in ASP.NET. Interestingly, the author has amended the article to recommend against rolling your own MVP, but if you choose the pattern, this is a good article to read anyway. Kyle Baley, the Coding Hillbilly, discusses how the redneck community views the difference between MVC and MVP.

You may also like to read this article about choosing a web framework for .NET.

And, lo and behold, Wordpress found this for me in the “this might be related” section: ASP.NET MVC vs Web Client Software Factory (which is MVP based)

Don’t Forget about Castle Monorail

And of course, ASP.NET MVC is the new kid on the block. The open source framework Castle Monorail has an established, mature MVC framework for ASP.NET. Interestingly the founder of Castle is going to work for Microsoft, but not for the ASP.NET MVC team.

Let me know if I left out anything critical, or you know of any good write-ups on the various options and the tradeoffs between them.

Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • DZone
  • Digg
  • Google Bookmarks
  • Ma.gnolia
  • Technorati
hello
Categories
ASP.NET, ASP.NET MVC, Web Development
Comments rss
Comments rss
Trackback
Trackback

« The Eye of Sauron (or, driving traffic to your blog by tickling a sneezer) So you want to learn NHibernate - Part 0, Overview »

discussion by DISQUS

Add New Comment

  • Subscribe:  This Thread
  • Go to:  My Comments ·  Community Page
  • Sort thread by:

    Viewing 8 Comments

    Thanks. Your comment is awaiting approval by a moderator.

    Do you already have an account? Log in and claim this comment.

      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Jesse Ezell 3 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      It depends on the quality of your developers, and how much time you want to spend dealing with customization. Web Forms is a big abstraction and is great when you want to just knock code out, but starts to fall short when you want complete control. When you want complete control, you could care less if you don't have 3rd party controls, because you are creating everything from the ground up anyway. All that abstraction just creates more hoops to jump through because you aren't taking advantage of anything it enables.

      MVC is really for the teams that want entire control of their application's output, so you shouldn't use it unless you dislike having a lot of controls in there doing magic that you have no control over. If you are really planning on doing a lot of custom CSS / AJAX work and are very comfortable with the inner workings of the web, you might find the freedom MVC gives to be pretty liberating... but don't do it unless you plan on and enjoy thinking about details like the individual HTML tags that get generated and what their IDs are.
      reply  edit  reblog  flag
      http://www.iserviceoriented.com /people/ac07dfc744599810f7787ac0bc73aa47/
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Nathan 3 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      Jesse, those are good points. I think ASP.NET MVC and MVC in general is about more than just control, although that plays a big role. Testability, built in support for IoC containers, a formalized separation of concerns, the tremendous weight loss achieved by dumping View State are also important considerations. I would almost say that if you want to realize an architecture for your app that DOES cleanly and intelligently keep business logic or data access out of your business layers you're developers need *more* experience and discipline if they are using ASP.NET WebForms than if they are using MVC, because in WebForms it is extremely easy for business logic and data access concerns to start creeping into bed with the view logic if you aren't very careful. I also tend to believe that the abstraction of Web Forms won't keep you safe from HTML - unless you're building some intranet app that is little more than scaffolding over a database - I've spent as much time tweaking HTML tags using classic ASP.NET as writing server side code, and even more time than that worrying about the ID's that were generate :) ). Not to say ASP.NET WebForms don't have their merits or that the abstraction isn't useful in many cases, just that there may be more to consider than just if (ControlFreak) MVC else (ClassicAspNet).
      reply  edit  reblog  flag
      /people/0c3d87f16b8502cd2dcf6d54707344fa/
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Jesse Ezell 3 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      I think you are right on with that.
      reply  edit  reblog  flag
      http://www.iserviceoriented.com /people/ac07dfc744599810f7787ac0bc73aa47/
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Mehul Harry 3 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      Nathan, good post. Lot's of links which I'll have to check out later. Are you on twitter? http://twitter.com/mehulharry
      reply  edit  reblog  flag
      http://community.devexpress.com/blogs/aspnet/ /people/70a52d3d4c13fa039bf02138050b0c82/
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Nathan 3 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      Harry, not a tweeter. I opened an account once, but the only thing it really did for my was disrupt my ability to concentrate even more than my RSS reader and e-mail already manage to do :) So are you guys working on some MVC stuff over there at DX?
      reply  edit  reblog  flag
      /people/0c3d87f16b8502cd2dcf6d54707344fa/
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Deependra Solanky 3 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      Very nice article, Nathan. There are a lot of useful links in this especially for newbies in ASP.NET MVC like me.
      Thanks for posting.
      reply  edit  reblog  flag
      http://www.madaboutanything.com /people/aa6cddeb7e14339d455b33769452ea9b/
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block username
        • Block email
        • Block IP address
      eibrahim 2 months ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      I think this might help http://www.emadibrahim.com/2008/09/07/deciding-...

      I would like to hear your opinion on it too. Should I add more questions? Does it even make sense?
      reply  edit  reblog  flag
      1 /people/eibrahim/ /people/eibrahim/following/ http://www.emadibrahim.com in/eibrahim eibrahim eibrahim
      • ^
      • v
      • Permalink
      • Admin
        • Remove Post
        • Block email
        • Block IP address
      Dan Hounshell 1 month ago 1 point

      Please login to rate.

      Do you already have an account? Log in and claim this comment.

      Thanks for the mention about the aspdotnetmvc.com site. I'm the person who built and maintains the site and I agree that there is way too much information in the main feed, primarily because of all the stuff picked up in the Buzz section (pulling from forums.asp.net, twitter, friendfeed, digg, dotnetkicks, etc). That section is not manually culled so it tends to overpower the rest. I would suggest subscribing to the individual sections minus the Buzz (blogs, news, video, and InAction) instead of the entire aggregate to lessen the noise. Actually now that I think about it I should probably put another aggregate feed together for everything except the Buzz for those who don't want to drink from the firehose.
      reply  edit  reblog  flag
      http://aspdotnetmvc.com /people/e7c11eaa560659318c0fe5c4d7fe6313/
     
    discussion by DISQUS

    Add New Comment

    Trackbacks

    (Trackback URL)

    • ASP.NET MVC Archived Blog Posts, Page 1

      July 29, 2008 at 1:00 pm

      [...] to VoteTo (ASP.NET)MVC or not to MVC (or, ASP.NET MVC Hyperlink Acupuncture) (7/29/2008)Tuesday, July 29, 2008 from hsidev.wordpress.comThe open ...

    close ()

    status via twitter

    recent comments (follow comments)

      View Profile ยป
      Powered by Disqus · Learn more
      close Reblog this comment
      Powered by Disqus · Learn more
      blog comments powered by Disqus

      Subscribe

      Calendar

      July 2008
      M T W T F S S
      « Jun   Aug »
       123456
      78910111213
      14151617181920
      21222324252627
      28293031  

      Recent Posts

      • You Can’t Fill an Imaginary Hole
      • I don’t know but I’ve been told, ETL is gettin’ mighty old. BAM! BAM! EDA! I want my data right away!
      • Be Prepared To Be Surprised
      • Google Chrome, I could kiss you! (Or, multi-process browsers are a really good idea)
      • New Open Source .NET CMS/EPS Platform Released Today: Sense/Net 6.0 Beta 1

      Recent Comments

      • nstults on Content Management Systems (CMS) for the .NET Platform
      • Adz on Content Management Systems (CMS) for the .NET Platform
      • nstults on I don’t know but I’ve been told, ETL is gettin’ mighty old. BAM! BAM! EDA! I want my data right away!
      • Hamilton on I don’t know but I’ve been told, ETL is gettin’ mighty old. BAM! BAM! EDA! I want my data right away!
      • nstults on Flowing Identity from a Client to a Service when using RESTful WCF Part 2 - A Solution

      Tags

      TDD Testing

      Meta

      • Log in
      • Entries RSS
      • Comments RSS
      • WordPress.org
      rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox