Compsoft Flexible Specialists

Compsoft plc

Compsoft Weblog Compsoft Website News Archive Privacy Policy Contact Us  

Friday, November 09, 2007

Tim Jeanes: Microsoft TechEd (Friday)

Today, at last, we got to see the new Microsoft MVC model in action. MVC (Model View Controller) is far from a new paradigm, but is Microsoft's first real venture into the MVC world. Thus we, the Microsoft fanboys, were about the only people in the room who weren't already using MVC in some other system.

I'm liking what Microsoft are doing here though - every step of the request/ response lifecycle can be swapped out, mocked for testing, or implemented by some completely other technology.

The full release of MVC for ASP.NET won't be out till midway through 2008, but the CTP release will be out in December 2007, and I just can't wait.

A major diappointment for me is that the first release will no real AJAX support at all. I guess I could hand-craft all my own javascript to make calls to the controller and receive JSON responses. That seems to be pretty well the only way of preserving the rich user experience that people want these days (short of mixing regular web forms pages in with the MVC model - which is totally possible, by the way). The question for me is whether or not it's going to be worth the effort. On the one hand I've put a lot of work lately into making our applications more user-focussed; on the other hand I've been frustrated for ages that we can't do any decent unit tests against the web projects in our solutions.

Our last session was on the power and weakness of reflection. We just love reflection - where performance is less of an issue, it's really handy for knocking out standard view or edit pages. This session took a much deeper dive into the power of reflection as well as how to generate code on the fly. This looks awesome! Using the new DynamicMethod class you can build your own methods at run time. You have to write it in IL - there's no C# here - which is pretty painful, but the free open source project "RunSharp" makes this a whole lot easier.

We've already been going to some length to improve performance by caching as much reflection as possible, but it looks like this can increase execution speeds by a factor of ten or more. The model we saw generated the code the first time it was needed, then cached it for re-execution later. This is fairly cute, but as Neil had just started playing with the BuildProvider class to hook into the compile process and generate code at that point, I think we'll end up using that: it means we can template C# code rather than using the more opaque IL, and also it happens at compile time, ensuring it's impossible to release un-executable code.

Seminars today: WEB05-IS (Matt Gibbs); GEN01 (Pat Helland); WEB04-IS (Matt Gibbs); WIN401 (Roy Osherove)

Richard Thomason: Microsoft TechEd (Friday)

Avoid pitfalls when hosting Windows Workflow with ASP.NET applications
This session demonstrated some ofthe issues to avoid, such as threading problems and avoiding long-running Execute methods during the rednering of a web page. The best solution for non-trivial applications is to write a separate module that does all the Worklow stuff, and then expose an interface via a web service. There is a neat control that allows you to show the current state of the workflow (same as in the designer) as a jpg, however this may not be all that useful for end user applications; it does raise the issue of what exactly is the best way to show the state of a workflow to an end user.

Etonyek speech
The closing presentation to the entire conference was by Pat Helland - industry guru and evidently replacement for Jim Gray (senior Microsoft R&D guru who went missing at sea in January this year.

The first half of his excellent presentation was a repeat of the one given by the AMD processor guy: more processors, more flash, less disks, no tape. For the second half, he tried to determine what the software consequences would be of that, and showed a vision video made by billg which showed a construction worker moving from home to car to work, with his workstate and profile travelling seamlessly through a variety of applications and devices.

His message was that future applications would be much more parallelised, with ways of recovering from differing decisions taken on different branches. Basically, you have no idea how much money is in your account, however you do have access to a variety of guesses at any one time. This is how a great deal of computing will happen in the future. He contrasted this approach with one where you must have the right result at all times, eg flying the plane by wire, launching the shuttle etc, but said that most of the computing space will be in the former space.

Henry Carter: Microsoft Tech-Ed 2007 (Friday)

First session was on the WCSF and building rich internet applications which was really interesting and while a lot of it I have seen and used previously, there were some really good extras which are now available and I think I will be using very shortly. In particular the ClientScriptCallExtender which will allow javascript to identify the client id of server controls without posting back, something which I have wanted to do many times and have always ended up with inelegant solutions. In all a good talk with a useful what’s coming next discussion at the end which identified some pretty nice VS integration features.

The next session I attended was discussion of an implementation of the service bus using Biztalk which is something I am really interested in but have no real understanding of what the implementation actually looks like so this was something I was really looking forward to it. The implementation was good to see and there was a lot of discussion around the new ways for implementing dynamic ports which is something apparently that has always been available but rarely used. Another fun point of this talk was that the ESB best practice guidelines had been released by the patterns and practices team this morning and so they were able to discuss these with us too. The demonstration broke however which was annoying but this led to a brief synopsis of how hard it is to actually set up initially and that the practice guidelines have a load of pre requisites which at the moment have to be guessed by the installing technician, hopefully this will change as discussion on codeplex continues and step by step guides emerge. Overall really interesting and definitely a technology I think we should spend some time looking in to for future projects.

They say always save the best to last and that is absolutely what transpired, Roy Osherove talking about deep reflection OMG!!!!

He gave us a brief overview of basic reflection which we have all seen before, then dived into some seriously cool stuff looking at generating code using reflection. Basically building methods and types generically, but not only that building generic methods using generic types generically! After my eyes had ceased to be crossed from that he gave us a 3 minute introduction to reading IL and then we were off on a magical mystery tour into building IL from inside a .NET the fast pace of the session was fantastic as we were able to cover a huge amount, including the different ways you can build IL inside your system as well as the performance benefits some methods have over others. He also touched on the security implications of exposing methods which use reflection and how the new methods in reflection 2.0 give you the ability to protect your code and therefore your system from the “EvilPlugin”. The icing on the cake of this session was however the trademark song which he performed as a finale. A rendition of “I don’t want to talk about it” by Rod Stewart with the lyrics changed to fit an experience of bad use of reflection. Very geeky but exactly the sort of thing that got him the only standing ovation I have seen this week. Great way to end the conference.


Neil Bostrom: Microsoft TechEd (Friday)

ASP.NET Roadmap
Matt Gibbs covers where ASP.NET is going and what new features the ASP.NET Futures team is working on. First he covered new AJAX support coming in the next release of ASP.NET. One major problem with AJAX currently is that as the user moves around your AJAX page their history button does not record anything. They are adding history support to the ScriptManager which means you can add history points to the browser that will replay AJAX events. With all this AJAX support coming and everyone writing in javscript, one problem they are tackling is a way to combine javascript files to limit the round trips and increase browser caching. New media player control introduced in ASP.NET. The control will render a silverlight control that will handle all the streaming for you. You can skin the control and add chapter support. AJAX has multi language support straight out of the box with a few lines of code. Matt showed a nice demo of ASP.NET Dynamic Data, showing how out of the box it will give you add / edit / list and view support. It creates the page code on the fly based on your database model in LINQ to SQL. Currently it only support LINQ to SQL but entities support is on the way. The major feature coming to ASP.NET is MVC support. I'm really excited about this as I believe that this will give us much simplier pages and more testability on our sites. There is a CTP in December coming and hopefully it will include MVC support.

ASP.NET Model View Controller (MVC)
This is another talk by Matt Gibbs but this time its just on the MVC and its also interactive session. Matt started off explaining MVC for the newbies and then showed some nice samples of what you can do using MVC. He also covered some testing senarios and how MVC helps in those situations. MvcUtil.ActionLink is a function to allow you to get urls to actions on the controllers. If you have different type of thing to render, you can provide your own view using IViewController and IView. So instead of rendering pages, you can render xml or binary or anything you like.

Deep Reflection - Things You Really Need to Know About Reflection 2.0
My favourite speaker, Roy Osherove gave a session on the power (and problems) with Reflection. Showed some awesome classes to create code on the fly. The example he gave was that you want to Clone a bunch of objects. The usual way you would do that would be to use reflection to copy each property to the new object. This turns out to be extremely slow with thousands of objects. Instead he used the CodeDom to generate a new method that copies each property. This runs as quick as any normal code as its just compiled to normal code. The CodeDom mode is very verbose and can get a little scary after a while. Roy then showed us the Flection.Emit which allows you to write IL code directly into the method. The lines of IL required are usually alot less than the verbose classes. Finally he showed us a library called RunSharp which generates IL from a friendly model. Fantastic talk, great job Roy!

Thursday, November 08, 2007

Richard Thomason: Microsoft TechEd (Thursday)

WF and Sharepoint
Using SP adds persistence and human interaction to WF, which is in Sharepoint "Site Collection Features". In SP, you have Templates, Associations, and Instances, so you create a template, associate it with a document type, then create instances of it. I think. A template is the WF program and any associated forms. Use InfoPath forms (requires MOSS server) - much easier to use and configure and no SP config blx. The demo failed utterly, and SP load is majorly slow. Not very impressive.

Sharepoint with Ajax,ASP.Net,Silverlight,Popfly
Some considerable config set up to do - look in Mike Ammerlan blog. Get ScriptManager installed in master page. "Extenders" add functionality to existing ASP user controls. WebPart demo used Extender AjaxControlToolkit:MaskedEditExtender. Ajax UpdatePanels can wrap WebParts. SmartPart is a webPart that can wrap controls as connectable WebParts - very cool, the full Customer / Order experience. The AjaxConnectionData class can both send and receive data to/from other parts. WebPart can also wrap Silverlight controls obviously, and Vista Gadgets (basically ASP web page) can communicate with SP too. Blimey. Get the config stuff at Mike Ammerlaan's blog.

Understanding ASP.NET Internals
This session went through the architecture of IIS and ASP.NET, and gave me enough information to realise it would be relatively straightforward to do an implementation of Equinox for IIS. However there would be a bit of a decision to make - whether to convert the necessary modules to managed code (in C#), or use ISAPI natively, which is a bit more ropey in terms of documentation and simplicity of implementation. Quite interesting in any case. Can host anything eg PHP, Equinox! The main ways to extend are via ISAPI filters and extensions (ie filename extensions). You can use aspnet_regiis.exe to register extensions if you install iis and in the wrong order. IIS 5 uses inetinfo.exe which talks to aspnetwp.exe which has the thread pools. IIS 6 has inetinfo again, but seeparates out the i/o into http.sys, which is a kernel level driver, so cached responses are lightning quick. There are no upgrade issues.
HttpContext object controls the entire lifetime of the request/response. HttpRuntime can use any .Net language, even VB. There's an interesting Cassini demo project which peeks into the webserver. Interception events can be either in global.asax or compiled IHttpModule components. Sessionstate make a hit both on input and output so turn it off if possible, or mark the page readonly. Can improve the performance of the server by running background events in a wake up every so often background thread. Sample available. Get example code from

Build your own IDE with Visual Studio
VS 2008 will ship with a redistributable package that allows you to deploy your development environment as an add-on to VS. In principle this is quite exciting, as it means that for a little work, ok possibly more than a little, you can leverage all the effort that went into developing the VS IDE. There appears to be considerable control over the look and feel, and there is a Visual Studio Industry Partner Program that you can join. An alternative to taking over the product completely is to build add-in packages for the development environment. The team have a stand in the product exhibition hall, and I intend to try and have a chat with the presenter guy later today or tomorrow. The possible products that you could imagine are a replacement for (parts of) Equinox, which would probably communicate with a non-VS standard Equinox program running in the background, some kind of on-top-of-VS development environment which maybe encapsulated the common code library and added extra tools and functionality to speed up Consultancy development, or an ESP editor, maybe in conjunction with an IIS runtime version. Who knows.

Developing with Exchange Web Services
MS is making a considerable effort with OL 2007 and subsequent versions to improve on the current rather poor and disparate set of services from MAPI onwards. Thegeneral principle is that all coding and parameters will be compatible with the Outlook GUI, which should radically simplfy the programming task. Web Services run on IIS, and use HTTPS and full authentication by default. OL 2007 includes a new algorithm for finding the best OL server for a given client, via an AutoDiscover service. A server on every site is recommended. There is a push or pull subscription service for notifications, and a delegate system which allows applications to impersonate users, via a user/mailbox/application authorisation mechanism. Powershell is a separate utility which manages OL resources, create / delete etc, and is also usable programmatically.

Tim Jeanes: Microsoft TechEd (Thursday)

Microsoft have developed a pretty sneaky method of protecting your source code. Normally with managed code, it's all too easy to reverse engineer your compiled code to get back to your original source code. Now though you can encrypt portions of your applications into a Secure Virtual Machine Language. Doing so also includes the corresponding Secure Virtual Machine in your application to decrypt and execute the MSIL. If we then reverse engineer the resulting application we see the original method names, but each contains only a call to the SVM. Our valuable code is held in an encrypted embedded resource file.

Admittedly executing such protected code is significantly slower than executing regular managed code, but you are able to select at the individual method level which parts of your application are protected. The best candidates, then, are those that contain sensitive information or proprietary algorithms but that aren't going to impact noticeably on the user's experience if they run slightly more slowly.

Additionally Microsoft have made it easy to associate license keys with these individual protected methods. The user will see an "activate this product over the internet" dialog when they first execute the application. Entering the activation key we've generated for them give them access to the application as a whole, but prevents them executing any individual protected methods that their license doesn't cover. We'd have to put in a little work to ensure the restricted features aren't shown to be available, but we can rest assured that the SVM will prevent them using reflection to hack the app and executing code they haven't bought a licence to use.

There are some nice improvements coming up for the next version of .NET. A slight surprise was back button support for AJAX pages. This give you the opportunity to alter the URL in the browser, adding items to the browse history, all without performing a full postback or updating anything outside your update panel. The URL can then be used as a permalink to the page in that particular state, so you'll have to put in some effort to ensure you keep sufficient state information in the query string.

The Astoria data services project automatically map URIs to LINQ objects, returning the results serialized as XML. For example, .../ProductCategory would return a list of all product categories, .../ProductCategory(5) would return the product category with ID 5, whilst .../ProductCategory(5)/Product would return all products in that category. The developer has full control over what methods of exposure of this kind of data are used.

It's always a toss-up at TechEd whether to attend sessions on topics you know something about already and want to learn more about, or to go and listen to something you know nothing about. The former can be very useful because it'll relate to your real life; on the other hand it may be a waste of time if you find you know it all already, or if what you learnt could have been gleened from Google in five minutes.

I attended a seminar on security in web applications (as I did last year) and, though it covered some new hacking methods I'd not seen before, I didn't come away with anything I felt I needed to change about the way we work.

The first of the two wild cards I picked today was cancelled (I guess now I'll never learn about publishing on-line comics with WPF) so I was stuck with the safe option (a Q&A comparison between the various flavours of LINQ). My second wild card - about SOA and multi-UI-based applications - showed me some awesome stuff that can be achieved but that I'll probably never reproduce.

A nugget of information from it was that the next edition of WF will (probably) give better support for querying the state of a workflow whilst it's serialized in a database. At the moment this information has to be duplicated manually and just feels too messy to me. Coupling that with how difficult it currently is to alter a serialized workflow has really kept me from using them in real life applications (useful though they are). I just know that our customers need frequent changes to their processes, so I think WF workflows would give me far more of a headache than I could do with until this process is made a whole lot easier.

Seminars today: SEC401 (Aidan Hughes); WEB310 (Mat Gibbs); TLA06-IS (Pablo Castro, Carl Perry, Mike Taulty, Luca Bolognese); WEB201 (Alik Levin); SBP307 (Clemens Vasters, Steve Swartz)

Richard Thomason: Microsoft TechEd (Wednesday)

Workflow communication
This session presented some low level features of WF - event handling and queuing using an asynchronous thread model. The latter means that you can't rely on your code executing in the same thread every time, and you need to create an Execute method that runs as quickly as possible. This creates significant threading issues but there are listener tools to help and you can start other processes and communicate with them. The presenter also briefly demonstrated Finite State Machine workflows, which look interesting!

Project Astoria
This project is a database tools group one, which aims to present a consistent interface to data to HTTP clients, whatever the underlying data store and whatever the client infrastructure! In order to do this, it uses standard tools already available client-side. Data is requested in either JSON or ATOM format, and you can insert, read, update and delete the data using standard POST, GET, PUT, DELETE http commands (apparently DELETE is an http command...). The framework will be known as "ADO.NET Data Service", and uses the powerful Entity Data Model available early next year as part of the LINQ query interface. There's a great demo using Silverlight on the client at

After lunch I looked in at a project using an add-in called bluePortal and Microsoft Expression Blend to create your own video content site. The Expression designer and the add-in worked simply together to create the site. The add-in uses standard interfaces to interact with current Microsoft browser technologies. The kit is in action at

.Net Scaling - Interactive Session
This was a highly technical, excellent session run by a very experienced ( developer which went through the big bang bullet points of running a very high volume, highly scalable ASP.NET system.

Following that was another mind-blasting on Windows Presentation Foundation and multi-threading. I was both relieved and dismayed to discover that all the familiar issues that were originally in MFC 10 years ago were still in WPF, however the good news was that WPF gives you a lot more tools to manage them. Basically the issue is that only the GUI thread should do GUI updates, and the GUI thread should never freeze. So what do you do if you have a long operation that must update the screen.

Richard Thomason: Microsoft TechEd (Tuesday)

The first session today was on Sharepoint. A number of customers and sales staff (and Phil) have commented that we should know more about SP than we do, so I was quite interested to see this presentation. The presenter was a SP MVP who clearly knew enormous amounts about the system, however unfortunately his presentation skills left a lot to be desired. Nevertheless a few things became clear. If you can use the SP facilities that come out of the box, either using the free ones or MOSS - the payfor version with more templates, you can get a result quickly with reasonable effort and little programming, and also you can delegate the responsibility for maintaining an application to non-development staff, in a similar way to using Public Folders in Outlook. So this is pretty powerful. You can also write your own code, however SP is very much a 3rd class citizen in this respect. There is little or no Visual Studio support, and a whole load of configuration needs to be done manually via batch files. All this sounds like a testing and maintenance nightmare, and so unless I can find better information during the rest of the week, my conclusion will be Keep It Very Simple with Sharepoint for the time being, and wait for a better development environment.

The second session was on Windows Workflow, which is fully integrated with Visual Studio, and has lots of powerful features for defining and monitoring workflow in an application. There is a decision to be made with this technology over whether you need it, or whether you just hard code the workflow into your application as you would normally do. The kind of questions to ask are: is the workflow complicated and suject to a lot of change, do I need lots of flexibility, are there lots of different and possibly inter-related workflows, do I need to monitor and audit the state changes. The presentation was not very detailed, but raised the main issues in a structured way, and clearly showed how the technology could be used.

Silverlight 1.1 final half
The afternoon session was to be on Silverlight and Expression, however hardware problems meant that I arrived as the speaker was ending his presentation, about 45 minutes early, so I went to the last half of the Silverlight 1.1 presentation instead. SL is difficult to pin down; it's a competitor to Flash, it can do many things that Javascript currently does, idem Ajax, it could completely replace the client-side object model and become the new programming API, but MS are keen to promote none of these, and are content to let market forces do what they will. Which is not very useful.

AMD64 optimisation
This very useful and practical session focussed on the various ways to optimise your non-managed code for 64 bit land. The story is that processor cores are going to multiply according to Moore's law, and that therefore memory will become the bottleneck. Moral: keep your data structures tight, simple, pre-feteched and in the cache.

Ajax / ASP.NET / Javascript OOP
This session showed how it was possible to take control of Ajax updating, via UpdatePanels, without using UpdatePanels, plus a preview of some advanced forthcoming technology implementing drag / drop functionality using a powerful OO implementation in Javascript.

Richard Thomason: Microsoft TechEd (Monday)

Mondday started with a whimper, as I discovered while buying the first day's Metro ticket that all my cash had been stolen! Barcelona lives up to its reputation. Fortunately however the wallet and all cards were still there, rather oddly, and we couldn't decide if a couple of Greek guys on the Ramblas were were in fact fantastic pickpockets, or whether I had dumbly left my wallet in the hotel room which had been serviced while we had breakfast. Time to forget about it and move on. Note to self however: get a waistband money belt and stop using a wallet.

The keynote session was delivered by the head of product development division, S. Soma Somasegar, a mature Microsoft manager with the normal company approach to developing software that works (see books by Steve McConnell) and a refreshing attitude to communication: get transparency in the development process at all levels, including with the early adopter community, listen to your customers, use the software that you sell (they use Visual Studio for all their development work), and create a community environment that involves the users participating in the creation of the online knowledge pool. Unusually for a keynote speech, this kept my attention for most of the presentation, and I was left with a feeling of confidence and optimism about current and future Microsoft products.

During the keynote presentations, and a subsequent tour of Visual Studio 2008, I was impressed by the thought and effort that had gone into the user interface - fabulous and useful Intellisense and other UI enhancements, which did make me wonder of someone had taken a very close look at Eclipse (the rival open source development environment). I found out that Popfly is an online tool that allows you to create your own website - "user experience" as they like to call it, and that Silverlight is a technology that simplifies the creation of graphics in a web page. There are some big debugging advances, including a Javascript debugger, and much better Web debugging overall. In VS 2008, you can customise the user interface for your own purposes, and the product manager showed a demo of a VS customisation for World of Warcraft, integrating their extnesion toolkit into Visual Studio.

Finally Luca Bolognese delivered a clear and articulate (although very Italian) introduction to LINQ, which is a successor to ODBC, and improves on it substantially . LINQ syntax is understood by C# and VB and can manipulate objects in a simple and powerful way. In addition to Web services, it would make sense to write a simple data provider for Equinox at some point.

Richard Thomason: Microsoft TechEd (Sunday)

An email arrived from Microsoft witha link to a page containing all of the sessions to be presented at TechEd, and asking me to make some preliminary choices. I took a quick look, and was a bit overwhelmed by the task, as there were a dozen or so threads - Visual Studio 2008, workflow, Sharepoint, architecture etc, and it seemed very difficult to choose presentations session by session, and still make sure I covered the threads that interested me.

So, I decided to do some Equinox V testing, and knocked up a quick application to help me do the job! After an awful but very effective hack job on the html page to divide it up into presentations and their details, I had the data imported and divided up into sessions, and all the presentations happening at that time as a child group. I could also sort the presentations on the code using a global index, which gave me the view of presentations by thread.

With a little more functionality to value and select individual presentations, I soon had a list by thread that I wanted to go to, and could switch between thread and session views to make sure everything was covered! Job done.

Neil Bostrom: Microsoft TechEd (Thursday)

Domain Specific Development with Visual Studio Domain Specific Language (DSL) Tools
This was an interesting insight into how Visual Studio (LINQ designer, Class designer etc) implements its designers. What it also raises is the fact that these designers can be written from scratch within Visual Studio using the Visual Studio SDK. This is something I've been looking for a while. We have an internal application that I need a designer for. The visual studio ones are perfect for it. The question I had outstanding was what support there is for extending the designers. So we would be looking to extend the built in LINQ to SQL designer to add our own custom code on the fly. Feedback appreciated if you can give any light on this topic.

Manual and Dynamic Mocks with C# and Visual Studio Team System
Unit Testing was the topic for this session. Mark Seemann gave some good advice on making your unit tests readable as they are a better version of documentation. If a developer wants to learn a system then handing him unit tests gets him up and running much quicker than any document really can. Described a nice framework for creating automatic mock objects called Rhino Mock. Seems to be a standard (or best so far) for creating Mock objects.

Web Security
Hacking websites is always amusing. Seen similar session last covering using SQL injection to browse server data. A nice little trick he showed was the ability to become a proxy between someones browser and a server, it would poison (spy and / or change) the packets as they went through the proxy. The session also covered a bunch of standard attack surfaces that I was already aware of.

Henry Carter: Microsoft Tech-Ed 2007 (Thursday)

This morning was a struggle after the UK party last night and I think there were a lot of tired people in the theatres however the sessions were exactly the right blend of humour and technical depth to keep me awake and alert throughout.

First up was a look at the new Windows Live platform SDK which is being released this week. Basically speaking this means that it will now be much easier and in fact more secure to let applications use the data held within the Live system (Live Messenger/Hotmail contacts and Spaces). The Live platform will hold a list of domains which you allow to have your data and will maintain that list. An application can then simply request access to the data and so long as they are on your list then live will provide them with the data they have requested. This adds functionality to the already present RSS from Spaces as it will allow applications to access private spaces which is currently impossible. Another nice feature that this brings is that you will no longer need to give social networking sites your user credentials in order for them to look at your contacts list and therefore build your network dynamically. You can simply give them permission to see your data and they can ask Microsoft for it.

Next up was a very conceptual talk about the building of an SOA application and the pitfalls to look out for. This was very interesting and the two presenters (Clemens Vasters and Steve Swartz) were a really fantastic double act, very funny but also working together to give a really broad appreciation of the subject and really projecting the wealth of their experience. A pity that they were silenced by the marketing guys about project OSLO but these things happen.

After lunch was a discussion of the top ten things that developers always get wrong and although this was heavily focused towards windows applications it still brought up some good points like using the Windows event log instead of proprietary error logging and scripting changes to the database and including this script in the release of your system rather than forgetting about it and then wondering why your bug fixing release has just broken the world (These are things which we do atm). This was very nice as a proof that what we do is right and nice to see that so many people had turned up to find out how to make their code and procedures better. Reassuring in a world where the daily WTF has such a wealth of choice for content.

The next session was web application security which was a really interesting demonstration of some of the possible ways to exploit systems if they have been architected badly. There was then a discussion of methods and architectures which would avoid these exploits from being possible in our systems. This was certainly useful and really fun to see just how easy it is in some cases to access data, and elevate your permissions on a server. Most of these I am happy to see wouldn’t be possible in the systems which we have been producing but it is really nice to see the ways in which we need to think when designing systems and also the tools and techniques which are available to test our code for possible exploits will be really useful when preparing our systems for deployment.

Last session of the day was a continuation of the SOA talk which I had attended this morning. This time however it was a practical example and demo of the ideas and architecture discussed earlier in the day. This really helped me to see the implementation and in fact the true power of the concepts described. I can really see the benefit of writing systems in this way and feel that they will definitely play a huge part in the way system development evolves over the next few years. Really exciting stuff.


Tim Jeanes: Microsoft TechEd (Wednesday)

Today we took a look at the some of the methods for making web pages run asynchronously - using AddOnPreRenderCompleteAsync or RegisterAsyncTask. Though these techniques won't make pages build any more quickly, they do keep threads free in the IIS thread pool, thereby ensuring other page requests aren't blocked. Without using these techniques, just one or two frequently-used but slow-loading pages can severely impact on the experience of everyone else using the whole of the rest of the website.

Unfortunately (in my mind) these methods aren't flexible enough. The asynchronous tasks can only sensibly be triggered during the PreRender event of the page - this is far too late to do anything other than displaying data. It's not possible to create controls input dynamically at this stage, for example, which you may well want to do based on the results of a slow-running database query. Though the RegisterAsyncTask method does allow you to call ExecuteRegisteredAsyncTasks at any time, this pauses the main page thread without releasing it - thereby negating any benefit you hoped to achieve from using an asynchronous page.

What I'd like to see is a number of points within the page lifecycle at which asynchronous tasks can be launched. PreRender is fine (and often desirable) for data display, but being able to launch them during the Init event would be far better if you need any kind of page interaction.

A seminar on building maintainable solutions highlighted some pretty cool features in Team System - both in the current 2005 edition and the soon-to-be-released 2008.

There's a nice performance profiling tool that can work light a strobe light against your code: you set your problematic slow-running method running and it'll report on where it found it was spending most of its time. The report it produces shows the entire call stack at each interval so it's dead easy to identify your bottlenecks.

The code coverage tools for unit tests aren't anything particularly new, but a nice feature is to provide the parameters for your tests (input and expected output) from a csv or xml file. I know I have a lot of tests that I wrote with a whole lot of cut 'n' pasting, so this will provide a much cleaner solution. As a bonus you have the tests be in the order given in the file or randomly. I'm a big fan of randomness in unit tests - not knowing what the test is that you're running is a great way of uncovering unforeseen errors.

The code metrics (new in 2008) are something I've not seen before. These analyse your code on a per-class or per-method level, measuring things like the number of lines of executable code, the number of branches, depth of class inheritance and how much one class relies on another. Each of these statistics are reported (providing useful pointers to good candidates for refactoring, for example), along with an overall maintainability score.

This gives me the fear slightly because I immediately know which parts of my code would produce the most "interesting" stats. Apparently studies have shown there's a direct correlation between the calculated maintainability score and the number of customer-reported bugs. The classes I'd least like to be analysed are the ones with the most unit tests (and thus the ones with the fewest reported bugs) - but was that just me compensating for what I know deep down to be unmaintainable code? We'll see...

On the flip-side of maintainability always lies performance. A seminar on producing scalable websites produced some handy pointers (I'll definitely be downloading the YSlow Firefox add-on to show me which parts of my page are taking time to load and to what degree caching is working for me. However our speaker was not a fan of LINQ at all: he hates the way it takes control away from the database layer and thus diminishes the performance benefits that compiled T-SQL stored procedures can give you.

I can see where he's coming from - and it does tie in with some of the debate we Compsoft TechEd delegates have been having amongst ourselves - but I think that LINQ will win for the way we work and the type of sites that we produce. Maintainability has always been more important to our customers than squeezing out every last drop of performance; it's far more common that they ask for a few fields to be added to their database than for them to want a page to load a half-second faster.

Speaking of design patterns - before we came out here, the Model View Controller design pattern was looming dimly on my radar but I wasn't too sure whether it was for us. It'd be quite a change from the way we work and though it initally looks quite beautiful from a purist standpoint, I wasn't really sure that it would work in my day-to-day real life job.

However, having attended a session on the new features of WCF in .NET 3.5 I'm suddenly very excited. It makes it very easy to handle specific HTTP verbs on URIs that match patterns you define, and easy to have it return your choice of XML, JSON or byte streams.

I think what troubled me most about MVC was that whilst it fitted the basic CRUD pages of an application very tidily, it's those tricky fringe cases that would be a headache: where you want to allow the user to spend some time on a single page building up a graph of objects before they hit the save button and actually cause an action that we want to handle in any persistent manner on the server side. These WCF features fit into place beautifully here: such a page would make WCF calls to the controller, returning (probably) JSON objects that we can handle in AJAX. We'd still be able to do any the tricky server-side logic we need to ensure the customer experience is a coherent one, but could delay any database interaction until that final save button click sends a POST to another URI that triggers a save action in the controller. Man, I just can't wait (either to play around with MVC - whenever it comes out - or at least to find out if my suppositions are on the right track)!

Seminars today: WEB401 (Stefan Schackow); TLA329 (Marc Popkin-Paine, Conor Morrison); DES304 (Guillaume Renaud, Dick Lantim); WEB02-IS (Stephen Forte); SBP312 (Steve Maine)

Wednesday, November 07, 2007

Henry Carter: Microsoft Tech-Ed 2007 (Wednesday)

What a start! Location aware database design and spatial data types. Having only heard of these things previously it was awesome to get shown the details and the true power of these types and their associated methods and functions by the guys who really have made it happen. The scope of the solution offered is immense and there was also a really fascinating discussion of the problems faced in indexing this spatial data. Including an in depth look at how they have gone about fixing this issue. Excellent talk, awesome technology.

Next up was a handy lab on tips and tricks for the C# IDE looking at new features for 2008 as well as little known features that have been in VS for the last few years. He started out making a promise that if anyone didn’t feel that they had learned anything that would make them more efficient in the talk then he would talk to them one on one till he could show them something that they felt was of use. To be honest if there was anyone who didn’t take 20 things away from that talk then they are spending way to much time reading the IDE manuals before getting down and coding. The session was full of really useful suggestions, keystroke combinations and development tips, as well as information on new features to VS 2005. I will take so much away from that session which will directly affect my productivity it’s scary.

Next for me was a session focussing on the server communication options in Silverlight and Microsoft AJAX. This was a very good presentation on a topic which I have been wondering about since my first session on Silver light on Monday. We saw how to connect not only to traditional webservice (asmx) endpoints using javascript and the Silverlight / AJAX libraries but also how to integrate with code-behind files as well as the MCF, looking into the depths of JSON too was a really interesting experience. These two technologies are definitely the way forward in so many ways and I’m really looking forward to playing with them and exploring how we can use them within Compsoft real soon.

My penultimate session was a ‘deep dive’, their phrase not mine ;-), into Virtual Earth, Microsoft’s offering to the online mapping genre. I have previously used Google maps extensively and was keen to see just how good VE was in comparison. To my absolute astonishment I came out thinking who the hell would use Google when you could use that!!!! Although the programming interface seems to be very similar and there is huge scope for doing more with the VE system

Last up was the most astonishing session I have been to, Building intelligent applications using data mining. This is a concept which I have previously only heard of and certainly never seen in any concrete or real world situations however this talk brought the concept of an application which can learn through data mining techniques to the forefront of my mind and I actually think that from what I’ve seen this could be something that gets out of the research academies and into applications very soon. Certainly I can see the benefit in learning much more about the tools which SQL server and .NET have for implementing models. I really didn’t know what to expect when I went into this lecture but I certainly wasn’t disappointed.


Henry Carter: Microsoft Tech-Ed 2007 (Tuesday)

Much better today. This mornings session on SharePoint was an honest appraisal of a solution which I had heard mixed reviews of. The discussion showed much of the power of the existing framework but acknowledged that there was much work needed to make sharepoint a slick development platform, it seemed to be a very capable system from a users point of view however deployment issues seemed to rain supreme. I think I will leave it till the angry face has been placated.

The second session on LINQ to SQL was the best so far. A really well presented and awesomely interesting presentation given by a true fanatic which was really good to see. The content was great with lots of code demos giving a real insight into the power of the LINQ framework. Definitely need to GIV in that.

During lunch Neil Tim and I watched the presentation on “Why Software Sucks” which was a humorous look at HCI and made some really valid points about the user experience and will certainly make me think twice about my users in the future.
First after lunch was an introduction to Open XML which is a standard which I have always hoped would live up to the hype. It seems that it has and there were some very informative demos in here to show the structure of ‘docx ‘ file types and the xml (as well as xml standards) which form their structure. The discussion was informative and there is the promise of more practical examples to come later in the week which will be good to see.

Next up was an under the covers look at C#, how excited was I!!!!!!! The whole thing was exciting, packed auditorium, Truly awesome presenter in Luke Hoban and a really exciting subject matter. This is the stuff I am actually going to be using from day one of VS2008 usage. He covered the stuff we all knew he was going to be covering, like Lambda expressions and anonymous types but in a really good way. Basically he used these new features among the many others to derive a solution for LINQ, itself a new feature of the language. He brought us through a world of factorisation and syntax optimisation to the point where most languages would have been happy then described why the c# team decided to take the language that little bit further to make LINQ a reality. Truly the best discussion and presentation I have seen, properly excited about getting in and trying this now.

Who could follow that? AJAX steps up to the plate and hits the ball out of the park and into the neighbouring state!!!!! Rarely have I walked out of a session thinking how much of what I have just seen I could have used in a practical environment in the last 6 months. Everything was relevant, everything was neat and cool and all the other Americanisms I have been picking up over the last few days, including a very Bostonian ‘wicked’. Basically AJAX rocks harder than Ozzy Osbourne and Metallica could ever, even if they both teamed up with Iron Maiden. The session was based on the page life cycle from the javascript point of view, and a lot of emphasis wa splaced on the ability of a savvy Javascript developer being able to extend and utilise the Microsoft AJAX framework without a whole lot of hassle, something which I have been trying to avoid since my first forays into AJAX development. Really enjoyable and a perfect end to a pretty damn good day.


Henry Carter: Microsoft Tech-Ed 2007 (Monday)

My first impressions on arriving at TechEd were that it was very well organised registration was a doddle and no queues whatsoever. Once we had got ourselves registered and orientated it was time to watch the keynote. This was presented very well and was (at points) really interesting. This was the point where we were told that Visual Studio 2008 is going to be released later this month. OMG it’s early!!!!! They then went on to show some of its features like javascript debugging and intelli-sense, as well as new and improved support for CSS (which was desperately needed).

Having listened to the keynote I was psyched for the first session. Whats the Future of .NET? This was a discussion about the way Microsoft think application development is going and I think on this point I totally agree. There was much talk of SOA and BizTalk as well as SharePoint, federalisation of identity (among other things) using AD. They also looked at the future plans for workflow and modelling technologies, which seem to be a core focus of the .NET plan. In all a really good start to the sessions, and a really nice introduction to the direction Microsoft think we are all headed.

The second session however was not quite what I had hoped for. SilverLight is a technology framework which has always impressed and fascinated me and so I figured I would go along and let Microsoft show me how I should be using it. However this was not the case. Whilst the presenter was totally enthused by the technology, this session simply showed us what XAML is, what it looks like and how to code very basic javascript to handle SilverLight objects. This was not what I was expecting or hoping for. I think I was not alone in this disappointment as a full auditorium became half full before the halfway stage. The one redeeming feature of this session was that it did underline the fact that when SilverLight 1.1 makes it into the really real world it will make this framework much more usable and easy to manage.

A disappointing end to the first day but I guess these things happen. We’ll see what tomorrow brings.


Neil Bostrom: Microsoft TechEd (Wednesday)

Building Highly Scalable ASP.NET Web Sites by Exploiting Asynchronous Programming Models

Stefan Schackow gave a good in-depth talk on how IIS and ASP.NET handles request and how this affects the available threads in the thread pool. To do any async work in pages you always need to add Async="true" to the page header. He first described using AddOnPreRenderCompleteAsync to run asynchronous tasks (database calls, web service calls, IO). Turns out this method is a backwards compatible method as its a bit useless since it does not allow you to run multiple tasks and you're also limited to getting your data after the prerender which is a little late to do anything with. A small catch me out is that in the end method of the async event no HttpContext is available. A better way to handle async tasks is to use the PageAsyncTask class. This class allows you to run multiple tasks and control when it runs and it still frees up the thread during the call. You would create a task and register it with the page using RegisterAsyncTask() method. To force the task to run earlier than the prerender, use the ExecuteRegisteredAsyncTasks() method.

Writing Maintainable and Robust Applications with Visual Studio 2008 Team Edition for Software Developers

This session gave a great impression on what tools are available to make sure that your applications are more likely to be bug free. One of the best tools show was the code coverage, which is now integrated with the unit testing framework within Visual Studio. Code analysis is something I believe we need to start using at Compsoft. They showed some good examples where the rules the code analysis runs raises some major issues which you wouldn't normally spot in your code. The unit testing tools shipped with Visual Studio 2008 have been improved with inline "Run Test" options. Code complexity is another tool that is shipped with VS 2008.

Entity Framework: Application Patterns

Pablo Castro brought a fantastic session on practical uses of the ADO.NET entity framework. Pablo went through a bunch of application architectures and how to use entity framework in each one. First he covered the simple 2 tier application like a console app wired up to a database. He then moved on to 3 tiers, giving web application as a sample. Finally finishing up with n-tier application using web service. One of the handy tip I gain during these samples is that you can turn off tracking of object on your context if you believe you're not going to be doing any updates. This massive improves performance as the context doesn’t need to track any objects. Another tip suggested is that you should never really cache your context, always create a fresh ObjectContext when making changes or working with the database. You can run into massive concurrency issues if you reuse context objects. All objects generated by the entity diagram implement ISerializable, this allows any object to be stored in the viewstate to be passed around your pages. When using the context object, always try to make sure you wrap it in a using statement. This makes the code “dispose” friendly in case any of the databases you're working with in your entities are not that connection friendly. Interesting topic was raised about setting foreign keys. Currently in our own framework we expose an Id property to allow direct use of the internal id when working with the objects. This helps in web applications when you most likely only have the id and don’t want to retrieve the full object to just persist the id. The nice thing is this has been covered in LINQ to Entities. (LinkName)Reference.EntityKey has the mapping to the integer of the foreign key. This allows you to retrieve and set the foreign key on an object without retrieving the full object. Pablo also covered the ability to cache LINQ statements for performance.

Tuesday, November 06, 2007

Tim Jeanes: Microsoft TechEd (Tuesday)

Today we saw a few more nice features that have been added to VS2008's javascript support.

First of all are the documentation-style comments you can add to your functions, just like in .NET. These are recognised by VS2008 and so appear in intellisense when you're writing your javascript, indicating the purpose of each function and any parameters. If you know that one .js file depends on another, similar comment tags can instruct intellisense to include the functions from that other file.

Also nice to see was how much easier it is now to call web services from within javascript, including catching the asynchronous result or failure. All with intellisense support, of course.

There was a point I missed yesterday about debugging javascript. When you debug a javascript file, Visual Studio grabs the javascript file from the browser: it doesn't assume that the .js file you had at compile time is what actually arrives there. Once you're debugging javascript, VS lists all the javascript files present in the browser and lets you put breakpoints in any of them. However, Visual Studio is clever enough to the map breakpoints from your compile-time javascript to what's found in the browser (and vice versa).

We also saw a whole load of more features of LINQ, this time focussing on LINQ To SQL. (That's SQL as in SQL Server, by the way. There'll be support for other SQL-driven databases such as Oracle with LINQ To Entities - due for release some time next year.)

Using LINQ to map your database to classes is ludicrously easy. VS2008 gives you a design surface onto which you position your database tables. ... and that's about all you have to do. That's sufficient for Visual Studio to create a class to represent each table in the database, properties between them to represent the joins, and a database context class to handle all your database transactions. This is very parametrisable: if you don't want to use the automatically-generated SQL to send data between your application and the database then you can easily wire up your own stored procedures.

If you don't like what the designer produces, you can take complete control yourself and build your own LINQ-enabled classes simply by adding attributes: there's a [Table] attribute for classes, a [Column] attribute for properties, etc.

This all fits in beautifully with the way we already work at Compsoft and we can't wait for LINQ to go live. It'll be a lot cleaner than the Gentle-based libraries we already have and will give us a whole lot more flexibility.

There's one issue that concerns us somewhat though: we find that our customers frequently want their databases to change. We're forever adding and removing fields, tables and joins. Though it's easy to regenerate your classes from the updated database structure, if you've done any customisation to that table (such as using stored procedures for the database transaction, or if you've changed how any of your fields will be represented as properties), those changes will be lost.

Most likely we'll be using the default settings for pretty much everything pretty much all of the time, so mostly this won't be an issue; however it's those tricky exceptional cases that could trip us up and take us by surprise when we change the database six months later. We'll have to see if we can catch someone at the "Ask The Experts" stand to get some guidance on this.

Though we're very excited about getting our hands on LINQ To SQL, LINQ To Entities will provide us with some nice further functionality. LINQ To SQL is limited in that you always get exactly one class for each table you're mapping to in the database.

LINQ To Entities will give you a load more flexibility and control over this. You can have your Customer class, for example, include fields from the CustomerContact table (so long as you provide the rules for how to do this). This will be beautiful - removing the hackiness of properties like Customer.DefaultContactName that we'll have to put up with in LINQ To SQL.

Conversely you can miss tables from your object model altogether, even though you're using them behind the scenes. The best example of this is that of a many-to-many relationship. Though you have a CustomerAddress table in the database, your object model can have just the properties Customer.Addresses and Address.Customers.

Moving away from the beauty of the upcoming backend language innovations for a bit, I took a look at what's coming up in SilverLight 1.1. This isn't so much my kind of thing - I'm much better at coding than at drawing - but it's nice to see how the next version of SilverLight will accommodate full C# support when it comes to altering it dynamically. Also, though in 1.0 javascript in your html can affect things in SilverLight, version 1.1 allows that relationship to be reversed: objects in SilverLight have access to all the controls on the rest of the page.

These two innovations give us a nice flexible model to work with. Our partners in the newly-formed BlueSulphur can focus their efforts on making beautiful-looking SilverLight objects, and we (the coders) will be able to control them from the page and also receive feedback from the SilverLight object to affect other controls on the page.

It takes a certain kind of courage to run a seminar entitled "Why Software Sucks" at a developer conference. It takes a certain kind of optimism to run it over the lunch break, and it takes a certain kind of genius to make it one of the fullest and most entertaining seminars so far. "Know thy user, for he is not thee" is what it all comes down to and is so true: it's far too easy to focus on writing great code rather than to focus on making a great user experience, and this is why - in terms of the number of complaints registered annually - software development fares worse than both debt collection and used car sales.

One gripe though: why must so many presenters insist that they "go ahead and..." do something instead of just doing it? Today I counted 21 "go ahead and"s in five minutes, peaking at four in thirty seconds.

Seminars today: WEB304 (Omar Khan); TLA308 (Luca Bolognese); LNC01 (David Platt); WEB302 (Jesse Liberty); WEB307 (Neil Padgett); DAT201 (Carl Perry)

Neil Bostrom: Microsoft TechEd (Tuesday)

Building a Complete Web Application Using ASP.NET "Orcas" and Microsoft Visual Studio 2008 (Part 2 of 2)
Omar continued the session on ASP.NET today covering new data controls, javascript support and intellisense. The new data controls shipped with Framework 3.5 are the ListView and Pager. These both have better support for data binding and are fully supported by LINQ. One of the biggest things to "wow" me in this session was the javascript intellisense support in Visual Studio 2008. It now has complete javascript intellisense, covering the HTML DOM and your own script libraries. The intellisense also support commenting so if you use the /// on a function, intellisense will show the information on use. Similar with ///. Also saw a nifty way to call a webservice within javascript without getting too complex about it. The ScriptManager control has a webservice sub tag that you can point at a ASMX page and it will add a proxy on the fly for that webservice.

LINQ to SQL: Accessing Relational Data with Language Integrated Query
This was mostly a refresher course to get a handle on the basics of LINQ again. Luca Bolognese started out with some basics on how LINQ works under the covers. His samples were clear and easy to understand. On a side note, I always forget about the ObjectDumper, what a top class for knocking out quick apps! He then went into more detail about the execution tree and IQueryable<>. He did mention something that stood out during his session. The LINQ team had done a bunch of work on making sure the SQL it produces is not only accurate and quick, it's also easy to read. So they have a simplify method at the end of the stack to see if any of the page long worth of SQL can be simplied. Very clever and so worthwhile!

Microsoft Visual Studio Team Foundation Server (Part 1 of 2): Applying Work Item Tracking and Version Control to Application Lifecycle Management
Kevin Kelly from the Team Foundation group covered a really good talk on the new features coming out in Team Foundation Server 2008. Spoke more in-depth about the uses of the TFS internally within Microsoft and the trouble they faced dealing with 7000 users, 1000+ project over 25 TFS's. Showed lots of nice fixes in TFS 2008. The one new feature that utterly sold me was the "annotate" feature. This allows you to right click any line of code in your solution and choose "annotate". This bring up a screen showing who has modified every line of code last in the file. This is fantastic for finding out who wrote that crazy line of code!

Developing Data Driven Application Using the New Dynamic Data Controls in ASP.NET
Dynamic Data Controls is a completely new topic for me. I was happily surpised to find it was Microsoft doing what we have been building interally for the last 6 months. Its still very much in the early stages but I believe its got good potential for being a good framework for knocking out our lookup management pages in under a second. It's a fully templated auto generated pages and controls for doing basic list, view, add, edit and delete. Currently it has a horrible web.config handler system for overwriting the default mappings. This however should all change when it gets more interaction with the new MVC framework coming out around the same time (mid next year). Hoping to get some more sessions on MVC later in the week. Very exciting topic!

Entity Framework Introduction
Carl Perry covered a good introduction on the ADO.NET Entity Framework. Discussing the basic direction behind the product and showing a good demo on how to get started with the current release of the entity framework. The entity framework has some awesome features including many to many mappings, mutliple tables to a single class (and visa versa). These are all key features I felt LINQ to SQL was missing.

Tim Jeanes: Microsoft TechEd (Monday)

Hooray for TechEd! It's great to be back in Barcelona again this year, with its heady mix of sangria, pickpockets and syntactical highlighting in Javascript.

Last year the New Big Thing was .NET 3.0 and we saw how WPF, WCF and WF would change our lives. This year it's all about Visual Studio 2008 and .NET 3.5. As Visual Studio is basically where I spend all day every day, and as I've been writing code comments along the lines of "... and so we have to hack it like this. I can't wait for LINQ!" for the last twelve months, this really does have the potential to make my life a better place.

Enough smalltalk - here's the highlights of what makes VS2008 great:

At last! Javascript is handled properly! It gets syntactical highlighting and intellisense and (even though it's running client-side) it can be stepped through in the debugger. This last feature only works in IE right now, but Firefox support is just around the corner. The intellisense is a work of genius as javascript isn't stronly-typed. If you reuse the same variable to hold an integer and later a form element, the intellisense will track those changes and show the appropriate methods at each point in the code.

At last! CSS is handled properly! This is truly a thing of beauty - not only can you make changes in the designer and have these changes reflected either in inline styles, embedded style sheets or separate .css files, but a handy panel shows which of your styles are in effect on each element. And here's the clever bit: if your styles conflict with one another, you're shown which one overrides which. This could spell an end to my biggest frustration in CSS: applying a style to an element and then scratching my head wondering which style in which of my other five style sheets is blocking it.

Visual Studio 2008 supports multi-targetting. This means you can easily switch your solution between versions of the .NET framework: 2.0, 3.0 and 3.5 are supported. Even if you're coding against .NET 2.0 in VS2008, many new language features (automatic properties, implied types, object initialisers, etc.) are still available. This is because they're just clever compiler tricks that resolve down to existing code features at compile time.

MY greatest excitement, though, has to be reserved for LINQ. If you've been anywhere near .NET in the last year or so you're probably already pretty excited about it so I won't explain what it is from the ground up but rather highlight some of its nice features as I meet them over the course of the week.

An example of LINQ usage we saw today was this:

var myResults = from c in SomeCustomers
where c.City.StartsWith("M")
group by c.City into g
select new {City = g.Key, Count = g.Count};

This takes a set of customers and finds all those in a city beginning with M, then returns a count of how many customers are in each of those cities.

Of course this is something you could have done before, but if you consider for a moment how many lines of code that would take, and how that would look when you return to your code in six months' time, you can see this is a big improvement.

Note also that we haven't said much about what "SomeCustomer" is. It could be a List, it could be a dataset you've got from ADO, it could be a lump of XML, it could be a datasource from LINQ to SQL. Actually all LINQ requires is that it's IEnumerable or IQueryable. As we already have IEnumerable<> in .NET 2.0, any existing list classes we have can immediately be used with LINQ. Similarly we can have LINQ talk to any bespoke datasources we may have kicking about the place (*cough*Equinox*cough*) so long as we can implement IQueryable<> against it.

Those two interfaces produce markedly different behaviour: In the case of LINQ To Objects (using IEnumerable<>), the compiler secretly codes up foreach loops for you and converts those "where" and "group by" clauses into regular .NET code. On the other hand, for LINQ To Datasets/ SQL/ Entities (using IQueryable<>), the compiler builds an object tree describing our query and passes it to whatever class implements the IQueryable<> interface.

However, as any coder knows, it's often the smallest feature you add that gets the biggest response from the user. The only new VS2008 feature that got a spontaneous round of applause was that when you click "Add New Item", the list of item types (class, web form, stylesheet, etc.) is now listed alphabetically. At last!

Seminars today: Keynote Speech (S. Somasegar et al); TLA201 (Daniel Moth); TLA318 (Luca Bolognese)

Neil Bostrom: Microsoft TechEd (Monday)

First job once we turned up is to get registered and pick up our Microsoft swag. The usual gifts awaited us, hat, bag, t-shirt, pens, pads, cds & pap. Next up in our grueling schedule was lunch. Moving into the main food hall we had some average at best food. While we ate, we all swatted up on what seminars were on in the afternoon. After an hour or so, we headed to our first session.

Building a Complete Web Application Using ASP.NET "Orcas" and Microsoft Visual Studio 2008 ( Part 1 of 2)
Omar Khan started by chatting about the new features in Visual Studio 2008. Covering the new HTML Designer (which is shared with the expression family) that has been rebuilt from the ground up. Also going into depth about the targetting, which also Visual Studio to develop code against a fixed version of the framework. This allows you to develop 2.0 applications using VS 2008. Omar then moved on to LINQ, giving a quick overview of the visual designer built into visual studio. He also covered the basics of the language features of LINQ, showing some nice demos on pulling records from the database.

Agile Development with Team System
I went to one of Roy Osherove last year covering agile development. He always does fantastic sessions so I was extremely excited about this session as we recently implemented Team System at Compsoft. As expected the session was very informative and fun. Roy is very honest during his sessions, he doesn't try to sell Microsoft. Just tells it as it is. He first covered the basics of agile development. Showing good diagrams on how sprint and scrum work together. He then moved on to Team System, showing the new features coming in TFS 2008. Thanking all that is holy that they finally rebuilt the build service to make it useable by customers. They have also improved the Team System interface within Visual Studio, fixing some nasty bugs. Nice little point he wrapped up with was about using FinalBuilder to outsource any complex operations in the Team Builds. I was recently struggling with a similar issue on a copy process for the publish of our builds in the office. FinalBuilder has a very simple interface with over 700 tasks to controls almost anything.