To (ASP.NET)MVC or not to MVC (or, ASP.NET MVC Hyperlink Acupuncture)
July 29, 2008Currently, 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
the 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.













Add New Comment
Viewing 8 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)
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 ...