Fest '08

Today I attended the Next Generation User Group Fest '08 event, which was held at the Microsoft campus in Reading. 

Next Generation User Group Fest 08 Logo

The theme of the event was "Data Today, Data Tomorrow" and there were several sessions, all devoted in one way or another to the subject of data.

Trophy for Best Nugget (Birmingham)First we had the introductory keynote session. The first 10 minutes of this was given over to Eric Nelson of Microsoft who was championing Visual Basic and promoting his new blog devoted to all things VB-related. The second part of the keynote was a review of the year from Richard Costall and Dave McMahon, co-founders of NxtGenUG. This included awards for the best sessions of the year and much to my surprise, I won an award for my Observer Pattern Nugget.

The next session was presented by Microsoft's Mike Taulty and was on the subject of ADO.Net Data Services. The goal of ADO.NET Data Services is to enable applications to expose data as a service that can be consumed by clients over a network using a URI-like syntax; for example the URI http://<domain>/Northwind.svc/Customers would return a list of Customers from the Northwind data service in XML format. Any session of Mike's is normally very good, but this was brilliant. He explained everything well and illustrated it with excellent code samples.

Next up was Dave Sussman who gave us a demonstration of the new ASP.Net 3.5 Dynamic Data controls. I was a bit disappointed with this session. The demo was hard to follow because the font on the projector screen was really small; it's annoying when presenters forget to reduce their screen resolution. The other reason I didn't like this session as much was that Dave didn't seem to engage with the audience as much as Mike had previously.

This was followed by a session on Windows Presentation Foundation (WPF) Data Binding by Josh Twist. For me, this session was the highlight of the day. Not only was Josh knowledgeable about his subject, he delivered it in a really accessible way and at the same time, he managed to incorporate one of the best demonstrations of Microsoft Expression Blend I've ever seen.

In the afternoon we were treated to an overview of the Microsoft Business Intelligence stack by Dave Morrow of Ridgian. I've seen Dave do this presentation before, but it was interesting to see how Performance Point Server now fits into the mix.

Next, we had an introduction to the new functional programming language F#, presented by Oliver Sturm of Developer Express. For me, this session was a bit too theory-heavy and didn't interest me as much as previous sessions, not helped by the fact that he ran out of time and cut short the most interesting bits.

To finish off the day, we were treated to some improvised comedy by way of a new NxtGenUG game show, "Whose Session is it Anyway?" Each speaker had to deliver a 7-minute presentation on a random subject such as "The Flying Spaghetti Monster: Fact or Fiction?", "Trout Tickling" and my personal favourite: "Carpets: What They Say About You and Your Business." It was absolutely hilarious and great to see the speakers send themselves up.

All in all, it was a great day. Once again, the NxtGenUG gang have set the bar even higher for next year!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

First Impressions of LINQ to XML

One of the new features in Microsoft Visual Studio 2008 is Language Integrated Query, or LINQ for short. LINQ is a set of extensions to both the Visual Basic and C# programming languages that makes it easier for you to query any type of data, whether its in a database, an XML document, or an in-memory collection of objects.

This week, I've been preparing a sample project for a presentation I'm doing at my local .Net user group. I needed to parse an XML document and create some objects based on the elements within the document, so I decided to see if all the hype around LINQ was really true.

I have to say it was even easier than I anticipated. As an example, given the following XML document:

<?xml version="1.0" encoding="utf-8" ?>

<Products>

  <Product ID="17" Name="Alice Mutton" />

  <Product ID="3" Name="Aniseed Syrup" />

  <Product ID="40" Name="Boston Crab Meat" />

</Products>

Let's say you want to convert this into a collection of Product objects, where a Product is defined as:

Public Class Product

 

    Private _id As Integer

    Private _name As String

 

    Public Property ID() As Integer

        Get

            Return _id

        End Get

        Set(ByVal value As Integer)

            _id = value

        End Set

    End Property

 

    Public Property Name() As String

        Get

            Return _name

        End Get

        Set(ByVal value As String)

            _name = value

        End Set

    End Property

 

End Class

All you have to do to convert from one to the other is use the following code snippet (add the System.Xml and System.Xml.Linq namespaces to the project first):

Module Module1

 

    Sub Main()

 

        Dim productXml As XDocument = XDocument.Load("Products.xml")

 

        Dim products = From product In productXml.<Products>.<Product> _

                       Select New Product _

                       With {.ID = product.@ID, .Name = product.@Name}

 

        For Each p As Product In products

            Console.WriteLine(String.Format("Product ID: {0}, Name: {1}", p.ID.ToString, p.Name))

        Next

 

        Console.ReadLine()

 

    End Sub

 

End Module

In fact, the code can be simplified even further, because you don't even need the Product class at all:

Module Module1

 

    Sub Main()

 

        Dim productXml As XDocument = XDocument.Load("Products.xml")

 

        Dim products = From product In productXml.<Products>.<Product> _

                       Select product

 

        For Each p In products

            Console.WriteLine(String.Format("Product ID: {0}, Name: {1}", p.@ID, p.@Name))

        Next

 

        Console.ReadLine()

 

    End Sub

 

End Module

If you are currently doing a lot of work with XML and are still using Visual Studio 2005, I would advise you to upgrade straight away, because the productivity gains you'll realise will be more than worth the price.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5