Go back

Tim Jeanes: TechEd 2008 Day 1

The first day of TechEd is shorter than the others - we start with the KeyNote speech at 2pm and have only two proper sessions after that in the afternoon.

Keynote speech

By far the most exciting things outlined in the keynote speech were the new features coming out in Visual Studio 2010.

For a start, the whole IDE incorporates WPF, meaning that many of the new features look a whole lot nicer. Making it easily extensible means you can add your own eye candy too,

The testing support has been vastly expanded: in VS2008 we could run automated tests but now we have a whole suite of support for manual testers. Test plans can be drawn up, and the tester ticks off the key points of them as they execute the test. As they do this, their whole session is recorded to a video file, with bookmarks at the points where they ticked off the various tests. Most impressively though, the route taken for the code to run, with full call stack and additional debug information recorded as every single line of code executes. When a bug is found, this gives the developer a ton of valuable information to track down and eradicate that bug.

A nice new feature for developing web applications is a way of scripting modifications to the Web.config file. No longer do you have to worry about remembering to remove the debug="true" statement and adjusting the connection string when deploying to the live server: those will all be changed automatically according to the build type.

WUX201 - Lap around the .NET Framework 3.5 SP1

This session covered the features they just couldn't wait until 4.0 to give us.

There are some big changes to how we can handle data now: the new Data Services make it possible to expose data over the web extremely easily. Though the quick overview we had here didn't show us how to secure that data, we are assured it is possible.

The ADO.NET Data Services map HTTP verbs (GET, POST, DELETE, etc.) to your standard CRUD operations. All you need to do is make a class that inherits from DataService (where T is your data context), and you're only a few lines of code away from URLs like "http://.../Customer" to get a list of all customers, "http://.../Customer(1)/FirstName" to get the first name of the customer with id 1, and even "http://.../Customer(1)/FirstName$value" to get the raw value without any XML wrapping.

This will play nicely with the new Entity Framework. I got my first real look at this technology in this session and hope to see a lot more of its depth as the week goes on.

From what I've seen so far, it looks a whole lot like LINQ to SQL. The designer's pratically identical, though we now also have the Mapping Detail view that shows how each property on your objects maps to the columns in your database.

I'm still concerned that reliance on the designer means we still hit a wall of pain when we come to change the database schema, but I hope to be proved wrong.

Moving on to a quick look at the MVC-style routing, it's felt good to be a bit ahead of the game: we've already moved up to SP1 at Compsoft and had implemented the MVC-style routing it offers even before SP1 came out.

WUX312: ASP.NET AJAX

In this session, Stephen Walther demonstrated the same simple website constructed five times over, using traditional ASP.NET first, then server-side AJAX, then three different ways of using the new client-side AJAX.

The first two of these are what we're used to, and (to be honest) are the easiest to develop, the safest to use (in terms of the compatibility of different browers' versions of javascript) and work just fine on an intranet (in terms of the volume of data sent about). However, they lack somewhat in terms of the user interface and aren't tremendously scalable, both because they pass a lot of data both ways, and because both of them result in the server having to process the entire page for every user button click.

In JavaScript, $addHandler is used in the pageLoad() method on the page. This is something I've not played around with much before - I've only really used UpdatePanels in the past - but it seems surprisingly easy to call web services from javascript, handle the JSON response, and construct the new html on the client.

ASP.NET AJAX 4.0 adds new controls, such as the DataView control, which allows you to define templates using html fragments with tags to inject specific data values.

As always, using AJAX produces some hurdles for accessibility. It can be done (and most of Compsoft's standard AJAXy controls have accessibility considerations built in). Fortunately for us, there are some new guidelines coming out soon for accessibility standards when working with AJAX. These are called Aria, and I'll be keeping an eye out for them as soon as they're available.

It was nice to see this approach in action with MVC too. The actions on the controller can return various types of response, including JSON, which is exactly what we need in this case.

The final method of using client-side AJAX was the most remarkable, where we put in all the behaviour entirely declaratively: by adding XML namespaces to the body tag, which in turn allows us to add dataView attributes to other elements in the page (the tbody tag of a table, for example), that then does all the work for you. Everything's extensible too: attributes are available to invoke commands in javascript when controls are clicked, etc.

This is a whole new world, and a whole new way to use javascript to make fast, responsive apps. I'm going to have to find some time to look into this in a lot more detail to see how we can use it in our real-world applications. It'll be quite a step to break away from our heavy dependency on UpdatePanels' callbacks, but this could be our way into MVC. Watch this space!

Got a project? Let's work together

Compsoft is a remote working company except for Thursdays when we work together from the Alton Maltings in Alton, Hampshire (UK). Our registered address is detailed below. We'd be delighted to have either a virtual chat with you or to make arrangements to meet in person.