Mando Group Labs

Work With us

If you have a proof of concept or RIA you would like us to develop email or call Ian on 0845 365 4040

Pitching up for web camps

It was another early start this morning for 3 members of the programming team (myself, Jon and Simon), to get to the Microsoft offices in Victoria for today’s Web Camps event, but it’s been well worth it…

Jon Galloway works in Scott Hanselman’s team (“Our team’s job is to make sure that you’re having a good time developing with Microsoft tools” – you’ve gotta love that) and along with Christian Wenz delivered an entertaining mixture of slides and demos which was worth getting up at 5am for. The schedule took attendees all the way from a snapshot of the Microsoft web platform as it stands today, right through some of the latest features of both web forms and ASP.NET MVC, and finished the day with a few associated topics such as jQuery, web deployment and IIS extensions.

Web developers using the Microsoft technology stack now have a choice of approaches when developing web applications:

ASP.NET technology stack

Personally, my objective in attending today’s event was to find out more about ASP.NET MVC 2. The first walkthrough describing the latest features of the web forms model in ASP.NET 4.0 was interesting to any developer who has previously grappled with the limitations of this approach. The benefits, such as the addition of routing for cleaner URL’s, greater control over ViewState to help reduce its size, and the ability to control HTML element ID’s for JavaScript and CSS targeting is all welcome news.

Viewstate, nom nom nomHowever, web forms is still a leaky abstraction; for example the existence of the “__VIEWSTATE” hidden field removes the overhead of state management for the developer, however the price to be paid is increased HTML page weight and potential SEO issues as spiders chomp their way through encoded data in the search for semantically significant content.

Being shown the evolutionary improvements to web forms and knowing that we were covering MVC next, I couldn’t help but feel like I was in a car showroom being shown the cup holders and sat-nav in this year’s Renault Megane, knowing very well that the dealer next door was about to offer me an Aston Martin for the same price.

For the record, our family car is a Scenic, and great cars they are too :) But you see what I’m getting at; the web forms model has its place, carries some benefits of its own, and continues to be supported by Microsoft. But the MVC pattern is a great fit for the HTTP protocol and client/server architecture, and a supported, native implementation for ASP.NET has been a long time coming when compared to other web frameworks (such as Ruby on Rails, Java J2EE). As Christian pointed out, it’s completely possible to write clean, well architected code with web forms, but it requires discipline to maintain this standard. Separating out the view, which acts as a ‘puppet’ simply displaying the model that it is provided with, and having this response orchestrated by a controller class and associated helpers not only improves testability of web applications, but also sets the tone for a cleaner architecture from the moment a developer clicks File -> New.

Some of my concerns about front-end developers maintaining MVC views were put to rest later in the afternoon, when the sessions covered HTML helpers and specifically templated helpers. Also touching upon dynamic data reminded me of the power of this scaffolding technology, particularly for anyone creating back-office administration systems. The ADO.NET Entity Framework was used throughout the sessions for data access, and the level of integration in the IDE, as well as with the rest of the web technology stack just demonstrated the level of investment Microsoft have made in their O/RM offering. It struck me that EF is far more mature in this release than when I first spoke to Eric Nelson about it at DevWeek in 2009 (as you’d expect), again all really exciting stuff for us Microsoft-focussed web geeks.

The sessions wrapped up by covering validation of business entities using attributes, and the support for the jQuery JavaScript framework. The validation model is certainly an improvement, reducing coding effort and supporting both server- and client-side options using the same metadata attributes, although I was a little disappointed that complex scenarios (such as dependency between properties) isn’t better supported. I saw a great demo of the open source FluentValidation project at one of the fringe TechDays events last month, and given the extensibility points built into MVC I’d love to see a FluentValidation provider for MVC (any takers)?

All in all, plenty to take in and plenty more to think about; many thanks to Jon and Christian for squeezing so much in. For anyone interested in further reading on any of these technologies, I’ve included some useful URL’s below:

About Matt Salmon

Head of Programming View all posts by Matt Salmon →
This entry was posted in .Net, Conferences & Learning. Bookmark the permalink.
  • http://blog.garypretty.co.uk Gary Pretty

    MVC really has been a long time coming and MVC 2 really does build on the foundation of its predacessor extremely well. I definantly agree about the templating support and the automatic scaffolding for editors etc. and have used them myself, with the validation support being an absolute bonus. I have only used MVC on small projects thus far, but maybe we can really test it at some stage!

    Glad you had a good time guys.

Share