MVC training day 1

We've had the first of our two half days with Steven Sanderson this morning. It was split in half, with the first half covering the new C# 3.0 language features and the second tackling MVC.

LINQ

We went through some fairly basic examples of LINQ to Objects just to bring everyone up to speed, covering the major language features involved (extension methods, lambdas, generic type inference, automatic properties, anonymous types and the like).

MVC

Moving on to the real meat of the session now! Steven first covered some of the reasons behind MVC. This includes things like the fact that we have fairly limited control over the rendered HTML with WebForms, a false separation of concerns and that it is fundamentally hard to test. He stressed that WebForms fundamentally does quite a good job of what it was designed to do, namely help people coming from a WinForms background in migrating to writing Web Apps. However it doesn't really 'play nicely' with the way the Internet really works.

We then went through a worked example, building up a sample application. Coming from a Perl/CGI background originally (before I got into ASP.NET) I felt that a lot of what I was seeing was very good and that it stands a chance of removing some of the dirty hacks that start to creep in when you want to do anything more complicated than 'My First WebForm'. It's important to recognise that it isn't for everyone however: you need to understand far more about the way the Internet and HTTP really work in order to get the most out of MVC. That said, if you do understand, you're going to be able to push the tech a lot harder before it starts to fight back!

I've watch a few presentations on MVC before, but this was the first time I've actually 'got my hands dirty' with it. I am really excited about the direction it's going. There's no doubt that you are forced to think about your web applications in a very different way when using it compared with WebForms, but I don't think that's necessarily a bad thing. It's certainly a technology that we're going to be exploring here in Red Gate's web division (although obviously you're unlikely to see anything written 'for real' in it until it goes to version 1 - probably some time in Q4 2008).

Tomorrow we've got sessions looking at unit testing and how it fits into MVC, followed by using jQuery and AJAX with it.

No Comments