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 GuthrieJeffrey 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.

Content Management Systems (CMS) for the .NET Platform

July 16, 2008

Currently we’re in the process of planning a rewrite of our vertical market portal system, delivered as SaaS, in order to bring it out of the stone ages of ASP.NET 1.0 and into to something a bit more modern, mostly so that it doesn’t feel so awkward mixing with our other, more cutting edge applications during customer demos and office integration parties. (We’re sensitive like that).

Anyway, building a portal system from scratch is tempting from a technologists point of view, but a bit silly from a business standpoint as the "portal" has been solved a few trillion times already using every web-capable technology known to man, ASP.NET included.

Choosing a CMS from the perspective of a SaaS vendor looking for a development platform to build a niche product and deliver it using flexible pricing models (including free, at times) is no easy task.

There are three major challenges in this process:

  • Flooded CMS Market: The sheer quantity of CMS systems for sale or for free. True, only a few rise to the top, but it takes a lot of sifting to figure out which ones.
  • Licensing: Not an issue with the open source projects in this review, but for most of the quality commercial products sporting open, powerful extensibility, this is a huge issue, and probably a deal breaker for us at the end of the day because we want the flexibility to throw our application on any number of servers at any time to suit any purpose without throwing fistfuls of money into the furnace each time we do so. This is probably not so much of an issue for shops wanting to build systems for their own companies, or for consultants or integrators building unique systems one at a time for their customers.
  • Technical Fit: This is sort of a two part problem – is the product under review capable of easily being extended to seamlessly integrate with and host our custom applications, authentication mechanisms and Asynchronous Messaging Lifestyle, and is the system documented well enough that it even matters what it is technically capable of.

Anyway, I’ve spend more hours than I care to admit scouring the web for CMS systems that will accelerate our time to market while using modern techniques and technologies (.NET compatible only) and at the same time offers a licensing model that will allow us to operate freely in our own marketplace. While the hammer hasn’t fallen yet in our decision making process, the licensing of models of the top tier commercial options are probably going to be too restrictive. But I’m listing them here anyway because our licensing needs are unique.

Commercial Products:

Sitecore CMS – very powerful, very polished product. They have a suite of web 2.0 collaboration modules you can buy, a "Foundry" product that allows you to manage large numbers of sites at once, and a nice developer, content designer and end user experience. Their licensing, though, didn’t work for us. They wouldn’t license their intranet / web 2.0 product to us at all because we sell to external customers, and their Foundry product had page limit caps on it. There were no other options, so, unfortunately, not for us.

Ektron CMS – Also a very nice product. The administrative functionality definitely feels a bit old school from a look and feel perspective (especially when compared to the Office 2007 Ribbon interface and "virtual web desktop" features of Sitecore) but the suite of pre-built portal controls can’t be beat. Well thought out, lots of social networking features, easy to integrate, very nice.  The sales experience was head and shoulders above Sitecore. The demo’s were all impressive, they have a blue million fully featured "starter sites" you can download and play with that feature various strengths and uses for the product, and the sales team is highly responsive, and willing to work with our devs to build a prototype during the evaluation process. I like this company a lot – BUT – you need to buy a server license for each URL – and we’ll host dozens of URL’s, many for small low-revenue companies, and so that may not work for us.

Kentico – well priced product, you can set up a sandbox without sales intervention and start playing around, plenty of features for the bullet point-sheet, BUT – it just felt a little awkward and clunky to me. Check it out for yourself, but it wasn’t quite what it needed to be for us to built our product out of it.

Episerver – The website got me all excited – the technology looks GREAT – but good luck buying the thing in the US. They only sell through partners, they only list three US partners on their site, and I couldn’t get a single one of them to call me back. Requests for sales support on their website went unanswered – SO… no thanks. (As if I had a choice).

Sitefinity – from Telerik, a vendor of very nice ASP.NET UI controls (and windows forms controls). Attractive site with workflow built-in, *very* inexpensive, but not in the same league with the other players in terms of functionality or maturity. Probably great for outward facing websites, not enough meat for our portal app.

Two others I didn’t carefully review but that look nice enough:

http://www.adxstudio.com/
http://www.contentxxl.com/Home.aspx

Commercial, but FREE?!

AXCMS – Support driven, like an open source project, but not open source. Odd duck. We haven’t looked at this one yet, just found it yesterday, but it looks promising. I’ll update this post once we’ve dived deeper.

Open Source

There are quite a few mature, open source CMS products for ASP.NET out there. Probably the most famous is DotNetNuke, but there are at least five or six mature competitors and a few nascent but promising projects as well.

DotNetNuke – I don’t have much to say about this project, except that it is hugely popular, but just not for me. The code base is in VB.NET, which isn’t a deal breaker, but not my preference all things being equal. Also the extensibility framework seems to be just a touch messy. My preference is to define controls that are fundamentally independent of a framework and easily wire them in. DotNetNuke likes things a little more intimate last time I checked. But there is a huge selection of pre-built modules to choose from for free, and many for sale, but also many of very low quality, so you have to be careful (although they are almost all very cheap, so the risk isn’t high). I believe DotNetNuke has a service organization, so you can buy professional support, and there are many, many vendors and consultants offering everything from full DNN implementations to skin designs.

Raibow Portal – I didn’t take a very close look at this project, even though it seems reasonably popular and quite deep. Mostly because it too suffers from the million-modules of questionable quality issue, and it isn’t very attractive our up to date feeling out of the box. If I’m evaluating a product and feel like I’m back in 1998, it is hard for me to stay engaged. Probably a personal issue, so don’t let it dissuade you from taking a peek.

Cuyahoga Project – this is a sparse CMS framework meant to be extended, and from what I can see extending it is not hard. It comes with a few basic modules, like a blog and news. The admin UI is clean and relatively un-adorned, and I believe its development takes an ALT.NET bent. We’ll be taking a closer look at this one. Documentation is a bit spar
se and scattered, though, but that is common in the ASP.NET Open Source CMS arena, it seems.

Umbraco – A very nice, relatively mature CMS. It is in beta for a 4.0 version with looks vastly improved, with a renovated plug-in architecture, ASP.NET Provider security, and many other enhanced features. The 4.0 release looks like it will be so much better than the 1.x version, we haven’t dived too deeply into the 1.x version and are seeing if we can hold out. This project also has rather spotty, user contributed-feeling documentation, but has an active and vibrant community to help balance that out. Also backed by a support organization if you want commercial support, and you can license the software cheaply for commercial purposes if you want to brand the administrative user interface. We will be taking a much closer look at this project in the near future as well.

[UPDATE:Here is a link to the Umbraco 4.0 beta page. This page provides an overview of the new features, as well as links to download a developer preview and a screencast on installing the developer preview.]

Portal Engine & Enterprise CMS – this project is open source, but not available yet. They seem to be preparing for an imminent beta release, but no source code as of yet. Of all the products I’ve evaluated so far, commercial or open source, this one has me the most excited by far. I do hope it becomes available in time for us to leverage it (and that it is all that it appears to be).

As of this afternoon (10/1/2008) the Sense/Net Beta 1 of this product is available on CodePlex. The product home page is here.

Here is how they bill themselves:

Sense/Net Portal Engine is an Open Source application suite for building integrated Enterprise Content Management (ECM, ECMS) and Enterprise Portal (EPS) solutions running on the .Net and Mono platform. Sense/Net Portal Engine TNG is an Open Source alternative to Microsoft SharePoint

Sounds great eh? It looks beautiful, appears to be backed by a large team, and also has a support organization. Actually, it is the next generation re-write of an established commercial ECMS product. The open source version is the next iteration, appropriately suffixed with TNG -  "The Next Generation." They cite as a motivation for the project the lack of an enterprise grade CMS in the open source, .NET space, and I have felt that same vacuum myself, so I’m keeping my fingers crossed. The best part, for me, is that they are providing a technology that I believe can be used outside the portal engine called the Portal File System, which is a robust, open source, hierarchical content repository with versioning and security, etc, like the Java cats have had forever but unlike anything that can be found in .NET (that I have been able to find). You can sign up for the beta, but you don’t get an e-mail when you do that confirms your request, so hopefully the sign-up is functional. Their blog is here: http://blog.portalengine.org/

Other open source projects I haven’t looked closely at:

http://n2cms.com/
http://www.devage.com/

And a nascent but active CMS being build on the new ASP.NET MVC framework:

http://www.codeplex.com/MVCMS

We’ll continue to explore, and report back once we’ve managed to build a few prototypes on the various platforms.