(Edit: This has been revised and updated since first posting on the night of the presentation — hopefully it’s a little clearer now)
Paul Stovell of Readify came to the NCG tonight to give a presentation titled “Windows Forms 2.0 Data Binding and Asynchronous Business Objects”. Paul’s comments and links from the presentation are here
This is the first “proper” presentation I’ve attended (in person), so I thought I should write up what my take on it was, and what I learned from it. (It also helps me to recall it later if I find this post)
It’s obvious by listening to Paul speak that he’s excited by the technology he’s presenting - it’s not something he finds a chore.
This results in having a lively presentation, with room for a few laughs and doesn’t become dry or boring.
Firstly, it should be noted that I have very little .NET 2.0 experience at the moment. Most of my experience is just fiddling in VS.NET 2005, with a small (personal) project for a Smart Device in the Compact Framework.
So, what did I learn?
Data binding under .NET 2.0 isn’t just mapping to Datasets/Datatables.
You can bind controls to any type of object (eg: Textbox.Text bound to DateTimePicker.CurrentDate, or Textbox.Text bound to MyCustomerObject.CustomerName), assuming it has been appropriately configured (it must implement a few bits of functionality).
I was always under the impression that you could only ever bind to a Dataset, Datatable, or something similar… the ability to bind to objects directly is great … I can see a bunch of uses for this in a project I’m working on right now, for example. And I’ll be using this to great effect in my personal CF project too.
Data binding is easy
Actually, it’s fair to say that in .NET 2.0, it’s dead easy - the IDE lets you drop a Data____ onto a form in various layouts, and it’ll go and create all the joining code.
If you want something more complex, you can drop databound
It takes more effort to write code to just get all the data in there “by hand” — than it does to do a bit of databinding (or so it seems) which has the ability to send updates as necessary.
Use Background Worker Threads to do any async work in your Business Objects
Using a Background Worker Thread inside your business objects is easy with anonymous delegates (no more Control.Invoke) - and you can implement the INotify___ interface on your classes and use a NotifyChange() to inform data bound objects that the data has changed.
Paul demonstrates this by having a Property getter go and calculate the total value of an account by Summing the rows, which then sends a NotifyChange message to all bound objects that the data has changed.
(the ___ stuff is me not knowing the full name, and it’s too late to and look it up right now)
The only things I think that Paul could do to improve the sessions can be summarised fairly easily:
Paul, Try not to let the presentation get ‘off the rails’ quite as much.
This was (in this presentation) caused by one or two people asking questions not relevant to the current thing that was happening. IMO - most of the questions not immediately relevant could easily have been punted to the end of the main part of the presentation. (eg: Going back to code that was on screen 30+ minutes ago gives a bit of a jolt to the thought process for me)
—-
Some personal observations:
It’s impressive to see Paul actually do most of the coding on-screen, right before us. I guess this is a confidence thing - I can’t stand people watching me code - because I start making mistakes a lot more than I would normally.
More prepared bits of code (”…and here’s one I created earlier!”) would make things a little smoother (less dependancy/type conversion/mistype issues).
Seeing that not everyone’s code is perfect is still fine and resulted in some things to happen that resulted in a few laughs.
I guess another thing I’m starting to pick up on is that C# really isn’t that different to VB.NET (at least, for most of the work) — I’m guessing I could probably switch to it in a month or two if I gave it a go and had a C# person to bounce stuff off.
The VB.NET jokes/comments by various people (Yes, that includes you Paul :P) reminds me of the Nikon/Canon rivalry in the meets I’ve been to for that.
Oh, and Some people in the audience don’t know when to stfu and stop hogging everyone’s time. I’m just glad that I managed to shut up for most of it.
