Thursday, March 11, 2010
 
   
 
Welcome to my site

First let me say thanks for stopping by my site. My name is David Hanson-Graville and I am a IT consultant working in the UK. Let me make it clear, I am passionate about technology and specifically .net and its various forms. I've programmed in a range of langages, but I can say, I am now at my happiest when coding with c#. I hope my blog is an enjoyable & educational read and please feel free to email me at David.Hanson@OnTheBlog.net if you have any questions. 

OnTheBlog Minimize
Author: David Hanson Created: Wed, 02 Jan 2008 20:28:49 GMT
All things .net, wpf, XAML, C#, Workflow Foundation and many more.

Defensive Coding
By David Hanson on Fri, 05 Jun 2009 06:33:18 GMT
How often have you seen code like this?
 
private void AllocateRoles(RoleChangeInfo roleChangeInfo)
{
            foreach (Role role in roleChangeInfo.Roles)
            {
                if (roleChangeInfo.Person.Age > 21 && roleChangeInfo.Person is Senior)
                    RoleChangeService.AddRole(rolechangeInfo.Person, role);
            }
      }
 
 
If we deconstruct this code we can see that the method AllocateRoles should received an instance of a RoleChangeInfo which is a container for all the information that is required to add the roles to the appropriate person. If we take a look at the implementation of this type we can see that it’s fairly simplistic.  It holds the ID of the Role and a RoleTaken DateTime.
 
public class Role
{
    public int ID { get; set; }
    public DateTime? RoleTaken { get; set; }
}
 
The body of the AllocateRoles method consists of a simple ForEach iteration around the Roles collection and with each role we check to make sure the person is older than 21 and they are of type senior. If both of these conditions are true then we call the RoleChangeService.AddRole method which will perform the work and update the RoleTaken.
 
I have come across this kind of code many times in the past and it is a good example of where a developer has made a number ...
Comments (2) More...

Microsoft® Silverlight™ 3 Tools Beta 1
By David Hanson on Wed, 18 Mar 2009 15:02:54 GMT

Want to start developing for Silverlight 3.0? Well you can now download the tools you need for Visual Studio from Microsoft.

Download here

Comments (0)

Silverlight 3: Some info!
By David Hanson on Wed, 18 Mar 2009 10:46:11 GMT

Today see's the start of MIX09. As a result I decided to look on the agenda for the sessions that are taking place over the next few days and I came across this little nugget if information on Silverlight 3. The session is titled "What's new in Silverlight 3" The brief synopsis gives us a sneak peak as to what to expect from Scotts Keynote.

"Take a tour of the new features in Silverlight 3 including a dive into some of the new experience oriented features like pixel shaders, perspective 3D, animation enhancements, bitmap APIs and improvements to the media stack. Also hear about new Silverlight base framework additions including updates to the style model, data binding improvements, improved resource handling and improvements to the web services stack."

Looking forward to those 3D demo's already!

Comments (0)

Next SLUG Meeting: Thursday 26th March 2009
By David Hanson on Tue, 17 Mar 2009 13:51:00 GMT

So it s been a while since I have blogged. I wont bore you with the details but what with moving home, project commitments and lots going on in my personal life I've just not had time to focus. This post is to get me started again .

The next SLUG meeting has been announced. You can find details of it here . Its going to follow a GROK TALK format, this means that anyone can have 15 mins talking to the group about experiences they have had with Silverlight. Mark is also looking for MIX attendees to come along and share their thoughts on this years announcements etc.

 

Comments (0)

Is BizTalk Dead - Part 2
By David Hanson on Wed, 26 Nov 2008 21:18:25 GMT

Back at the beginning of the year I wrote a blog post about the awkward conflict that BizTalk faced now that WF was on the scene.  Although at the time of writing there was an obvious cross over between the products, BizTalk still offered a number of key advantages over bog standard workflow. Due to some emails I received I decided to look around Microsoft's code projects and see what I could find. It was way back in Feb that I came across OSLO.

9 Months later and with PDC out of the way, OSLO and Microsofts strategy for WF is far more clear. OSLO seemed to evolve over the last few months into the codename primarily used for the modelling language and toolset announced. Microsoft also showed off a whole new version of WF for .NET 4.0. This new version of WF comes with some major improvements.

  • WF has been rewritten from the ground up.
  • Performance has been dramatically increased
  • Services and Workflow can be written purely with XAML
  • A new customisable designer surface
  • Large number of new activities for developing workflows
  • Seamless integration with WCF

So with WF being upgraded to a spanky new version which offers a wealth of new features please bare in mind that BizTalk'ers are still waiting for their orchestration engine to be updated to use the new WF engine. Given the new version of WF being announced I would be wondering how long its going to take before I see that in BizTalk?

Back to the original OSLO article I found way back in Februrary, the article talked of a new WF hosting engine. This part of the puzzle we now know has been codenamed "Dublin". If you haven't heard of Dublin yet and your into BizTalk then hold your breath as the diagram below (taken from MSDN) may look familiar.

 

 Dublin is the application server that has long been missing from the Microsoft product set. Announced to be a part of Windows Server , Dublin provides a runtime which hosts WF workflows and provides services for persistence, tracking, management, message forwarding and much more. The Dublin runtime is implemented on SQL Server server which allows WF developers to create long running workflows. Prior to Dublin this was only possible by either rolling your own or implementing BizTalk.

Is this sounding familiar to you? Well it doesn't stop there I'm afraid. Dublin can also run as part of farm of servers whereby each instance  can use a single shared persistence store. Dublin also provides automatic workflow activation as part of its message routing architecture.

As you can see Dublin is the future. Even Microsoft recognise the awkward overlap of features as evidenced by this MSDN article.


For anybody familiar with BizTalk Server, looking at “Dublin” might cause a slight sense of déjà vu. Supporting workflow-based logic, providing a monitoring and management infrastructure: These are things that BizTalk Server does today. What’s the future of BizTalk Server in a “Dublin” world?

The key thing to understand is that “Dublin” doesn’t directly target traditional BizTalk scenarios. For example, enterprise application integration and business-to-business connections via EDI will still use BizTalk Server. Similarly, bringing existing applications into the service-oriented world by exposing their functions and/or data through BizTalk Server will continue to make sense. While the reach of “Dublin” may grow over time, BizTalk Server r ...

Comments (1) More...

Silverlight 3D confirmed!
By David Hanson on Mon, 17 Nov 2008 14:16:48 GMT

Scott Gu has a post today highlighting a couple of features that we can expect to see in Silverlight 3. Good to hear on the list are the following

• Increased databinding support (Lets hope we get element binding)
• 3D graphics support (With GPU Acceleration)
• H.264 Codecs for high quality video streams.

His full post can be found here

Comments (0)

C# 4.0 and Dynamic Objects Part 1
By David Hanson on Thu, 13 Nov 2008 00:19:26 GMT

Over the last week I have been watching a number of sessions that were recorded at PDC. One that I particularly enjoyed was Anders Hejlsberg “Future of C#”.

During this talk Anders provides a brief introduction to dynamics support in C#. If you’re not sure what dynamics really are then the best way to describe it is the ability to perform lazy evaluation of an objects data type & members at runtime. To make this clearer we can look at C# as it stands today as a purely static language. If we define a new class within c# 3.5 show below we are generally bound to use only the members that have been defined on the contract.

    public class PlainOldObject

    {
        public string Name { get; set; }
        public int Age { get; set; }

    }

Now when it comes to using the PlainOldObject class we can only do so in a limited way as compilation will fail if we try to access properties that do not exist. Take for example

            PlainOldObject plainOldObject = new PlainOldObject();
            plainOldObject.Name = "Dave Hanson";
            plainOldObject.Age = 30;

            plainOldObject.FavouriteLanguage = "c#";

This fails compilation with an error of “'PlainOldObject' does not contain a definition for 'FavouriteLanguage'”. In order to get this code to compile in our current c# 3.5 code we need to go back to the class and implement a new property called FavouriteLanguage of type string.

Introducing the Dynamic Type

Dynamics support in c# 4.0 solves this issue for us! In C# 4.0 a new static type is being introduced called dynamic. The dynamic type tells the c# compiler to ignore type checking at compile and instead leave the evaluation until runtime. The dynamic type can be applied to any .net type but more importantly it can be applied to external resources such as XML, COM objects and Scripts.

...
Comments (0) More...

Silverlight UK usergroup session video - 1
By David Hanson on Wed, 12 Nov 2008 14:58:28 GMT

If you didn't manage to make it to the Silverlight UK user group last week then you may want to check out this video below. This is session one by TrickyBusiness who outline there design approach. Enjoy.

Comments (0)

Goodbye Linq to SQL?
By David Hanson on Fri, 31 Oct 2008 13:44:31 GMT

An interesting post has arrived on the Ado.net team blog with regard to the future of LINQ to SQL. Although not coming outright and saying it, it seems that LINQ to SQL is likely to be deprecated in the future in favour of Entity Framework. 

“We’re making significant investments in the Entity Framework such that as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios”

So this leaves the question, what will customers who have implemented LINQ to SQL do for long term support. I would like to see Microsoft provide clear guidelines and tooling in order to help those unfortunate ones migrate their existing software forward. The good news is that the awkward gap between LINQ to SQL and EntityFramework now seems to have been resolved.

Comments (0)

New Silverlight Controls
By David Hanson on Wed, 29 Oct 2008 23:02:25 GMT

For those of you coming from WPF to Silverlight you often find yourself frustrated when you find that Silverlight is lacking some very useful controls that you take for granted. Well today at least that gap is narrowing..... As here you will find on codeplex the Silverlight Toolkit. http://www.codeplex.com/Silverlight

With this release you get additional layout controls such as Dockpanel, ViewBox, Wrap panels etc as well as some more advance controls such as expanders and charting!

I heard a while back these would becoming as an additional download so glad to see them finally arrive. Expect ALOT more in the near future!

Comments (0)

PDC: Office via Silverlight
By David Hanson on Tue, 28 Oct 2008 20:34:47 GMT

Well there are announcements coming left right and center from PDC this year. We've heard about Azure and Microsoft's move to provide cloud services. We hear details of Oslo and Dublin and what they will mean for the future of language developement and modelling.

And then one very important announcment from Microsoft which shows their commitment to Silverlight and related technologies is the announcement that the next version of Office will come with a web enabled version powered by Silverlight. Their is a video posted on Channel 9 about this that shows small demos of Silverlight Word, Excel and One Note. VERY COOL!

This is the future of RIA's and software as a service and I am looking forward to see how Microsoft's competitors continue to compete now that Silverlight and .Net are going cross platform.

Comments (0)

New .NET Logo!
By David Hanson on Sun, 26 Oct 2008 08:36:35 GMT

Well after 8 years Microsoft has decided to update the .NET Logo. I always like the old one but I think the new one is even better.

I've read in the blogs that this new logo is already in place around PDC. One thing about this logo is that it brings a feeling of familiarity and I'm not sure why. Perhaps its because it uses similar colours and gradients as those found in Photoshop CS3?

Comments (0)

Silverlight 2 Released!
By David Hanson on Tue, 14 Oct 2008 11:22:00 GMT

Well its official, Silverlight 2 is now complete and available to the public. The full press statement can be read here.

http://www.microsoft.com/presspass/press/2008/oct08/10-13Silverlight2PR.mspx

The total download size weighs in at 4.64Mb so still pretty compact. Hats of to Microsoft for squeezing so much functionality in!

Highlights of new Silverlight 2 features include the following:

• .NET Framework support with a rich base class library. This is a compatible subset of the full .NET Framework.
 
• Powerful built-in controls. These include DataGrid, ListBox, Slider, ScrollViewer, Calendar controls and more.
 
• Advanced skinning and templating support. This makes it easy to customize the look and feel of an application.
 
• Deep zoom. This enables unparalleled interactivity and navigation of ultrahigh resolution imagery.
 
• Comprehensive networking support. Out-of-the-box support allows calling REST, WS*/SOAP, POX, RSS and standard HTTP services, enabling users to create applications that easily integrate with existing back-end systems.
 
• Expanded .NET Framework language support. Unlike other runtimes, Silverlight 2 supports a variety of programming languages, including Visual Basic, C#, JavaScript, IronPython and IronRuby, making it easier for developers already familiar with one of these languages to repurpose their existing skill sets.
 
• Advanced content protection. This now includes Silverlight DRM, powered by PlayReady, offering robust content protection for connected Silverlight experiences.
 
• Improved server scalability and expanded advertiser support. This includes new streaming and progressive download capabilities, superior search engine optimization techniques, and next-generation in-stream advertising support.
 
• Vibrant partner ecosystem. Visual Studio Industry Partners such as ComponentOne LLC, Infragistics Inc. and Telerik Inc. are providing products that further enhance developer capabilities when creating Silverlight applications using Visual Studio.
 
• Cross-platform and cross-browser support. This includes support for Mac, Windows and Linux in Firefox, Safari and Windows Internet Explorer.
 

Comments (0)

NHibernate Query Generator
By David Hanson on Fri, 10 Oct 2008 11:01:38 GMT

My good friend Andrew Clancy at Conchango has written an interesting blog post about the benefits of using the NHibernate Query Generator. We have been actively using this in our project and we find benefits every day. Check it out.

Blog post here

Comments (1)

Remix 08: Silverlight Info and Leaks
By David Hanson on Tue, 23 Sep 2008 19:54:04 GMT

Scott demonstrating ASP.net MVC

Well Remix is over and my thoughts post event was that it was a bit of let down. Unfortunately PDC is right around the corner and as a result no new major announcements were being made. Before attending I made a promise to myself to mix equally between design and development orientated sessions.

While there I got to speak to some great people and discuss topics ranging from visualisation techniques to the duplex communication in Silverlight. I was also lucky enough to grab a few moments of Scott Gu’s time and discuss a few Silverlight specifics. 

  • No MergeDictionaries for RTM - I was mortified to hear that MergeDictionaries is not going to make it into the RTM. I cannot believe that we have to specify all our styles and resources in our App.xaml for the foreseeable future.  This is particularly annoying if you are trying to migrate a WPF app to Silverlight.
  • H264 will miss RTM – I kind of expected this one as it was only recently announced. But Scott clarified it.
  • Charting controls coming – It looks like the Silverlight team are working hard on more advanced controls and Scott let slip that charting controls are to be included.
  • Silverlight automatic update – In one of Scott’s sessions he confirmed that Silver light 2 Beta 2 installs will automatically upgrade to the RTM.
  • Ribbon bar for WPF on track – It looks like the Ribbon for WPF should be due sometime this year. I asked if we can expect to see this in Silverlight soon and he confirmed it was NOT on the current development schedule. (Damn).
  • Silverlight not the preferred platform – I asked Scott if I could expect to see innovation happening in the Silverlight space from now on given that the VSM was developed for Silverlight first. Scott said there was no particular decision on which came first, however they will be trying and reduce the issue of code portability between WPF and Silverlight apps.
  • And Finally - 3D was pretty much confirmed. When asked by a member of the audience when will we see 3D support in Silverlight Scott’s grin couldn’t be hidden. He kept saying “Well that would be a compelling option”. I’m expecting to see this announced at PDC.

So generally I had a good couple of days but felt some of the session’s could have been a little more tech and less big picture. Next year perhaps.

 

Comments (0)

Print  
Tweets Minimize
Twitter / LordHanson
  1. LordHanson: My vaio p is doing well while travelling. 3g Internet, HD movies, digital tv, photo editing, wifi router for iPods and much more. Love it

    Published Wed, 10 Mar 2010 10:29:19 +0000 by
  2. LordHanson: Ok so I need to stay techie while away from a computer for a year. Anyone got any ideas.

    Published Mon, 22 Feb 2010 12:31:09 +0000 by
  3. LordHanson: Sitting in YHA Glebe Sydney waiting for the movie night to start

    Published Thu, 18 Feb 2010 08:13:10 +0000 by
  4. LordHanson: Madness today. We only booked our return tickets to bangkok on the wrong day! Luckily we managed to change them!

    Published Wed, 10 Feb 2010 15:54:37 +0000 by
  5. LordHanson: HTML5 the future? http://bit.ly/6yf9Bu

    Published Tue, 09 Feb 2010 13:43:48 +0000 by
  6. LordHanson: Last night in Bangkok! Good fun!

    Published Thu, 04 Feb 2010 18:09:38 +0000 by
  7. LordHanson: @trampussandal Dad? lol

    Published Thu, 04 Feb 2010 05:26:39 +0000 by
  8. LordHanson: Im sitting in a coffee shop in my home town of epsom thinking... Man the day has finally arrived. I can feel the stress lifting.

    Published Mon, 01 Feb 2010 09:05:13 +0000 by
  9. LordHanson: So what excuse will apple use to not allow flash or silverlight to run on the ipad this time I wonder.

    Published Fri, 29 Jan 2010 19:07:46 +0000 by
  10. LordHanson: Yay just manage to upgrade from vista ultimate to windows 7 enterprise by using the registry hack trick. No reinstalls.

    Published Wed, 27 Jan 2010 07:18:07 +0000 by
  11. LordHanson: @swhelband Sure am...http://bit.ly/aZ6Xvd

    Published Tue, 26 Jan 2010 19:05:18 +0000 by
  12. LordHanson: I finished work today in prep for travelling. I must admit as i left the office i felt a little emotional. Sign of a good job with great ...

    Published Tue, 26 Jan 2010 17:48:49 +0000 by
  13. LordHanson: So, today is my last day of work before i leave for australia. And it just happens to fall on australia day too. How very cool.

    Published Tue, 26 Jan 2010 08:51:42 +0000 by
  14. LordHanson: Well woke up at dads this morning. Didn't sleep too bad considering.

    Published Sun, 24 Jan 2010 10:08:25 +0000 by
  15. LordHanson: RT @BillGates: My new website is live check out www.thegatesnotes.com. Excited to share more about what I’m learning, hope you like it!

    Published Fri, 22 Jan 2010 14:11:24 +0000 by
  16. LordHanson: @DJTravelling need to watch out of people carrying illness over the next week. They are everywhere!

    Published Fri, 22 Jan 2010 08:22:24 +0000 by
  17. LordHanson: Lots of sick sounding people creeping onto the trains today. Stay away stay away!

    Published Fri, 22 Jan 2010 08:14:36 +0000 by
  18. LordHanson: @RoyOsherove come back to the conchango offices for some real fusball competition!

    Published Thu, 21 Jan 2010 22:49:34 +0000 by
  19. LordHanson: RT @connectifyme: #Connectify Blog: Announcing Connectify v1.1! http://bit.ly/5og7vI

    Published Wed, 20 Jan 2010 16:31:48 +0000 by
  20. LordHanson: LMAO RT @colmbrophy: so have you seen who owns http://wwwbing.com ? it's not microsoft

    Published Tue, 19 Jan 2010 17:35:43 +0000 by
Print  
Archive Minimize
Print  
Contact me Minimize
Print  
Microsoft Certs Minimize







Print  
Silverlight News Minimize
Silverlight - Google News
  1. MSN Video takes on BBC iPlayer with ad-supported online TV offering - The Guardian

    Published Wed, 10 Mar 2010 17:37:35 GMT+00:00 by
  2. MSN decides to keep its makeover - CNET

    Published Tue, 09 Mar 2010 17:00:15 GMT+00:00 by
  3. Adobe, Microsoft Bringing Flash To Windows Phones - ChannelWeb

    Published Thu, 11 Mar 2010 00:53:11 GMT+00:00 by
  4. Where to Watch March Madness Online - NewTeeVee (blog)

    Published Thu, 11 Mar 2010 02:03:27 GMT+00:00 by
  5. Windows Phone 7 to support .NET, Silverlight, XNA - Seattle Post Intelligencer (blog)

    Published Fri, 05 Mar 2010 02:23:29 GMT+00:00 by
  6. Small Basic 0.8 and Silverlight - Softpedia

    Published Tue, 09 Mar 2010 11:59:10 GMT+00:00 by
  7. Microsoft banks Windows Phone 7 on Silverlight - Register

    Published Thu, 18 Feb 2010 06:02:11 GMT+00:00 by
  8. Adobe, Microsoft Spar Over Flash, Silverlight, HTML5 - InformationWeek

    Published Fri, 05 Mar 2010 21:48:08 GMT+00:00 by
  9. Microsoft VOD service - IAB UK

    Published Wed, 10 Mar 2010 15:08:14 GMT+00:00 by
  10. Android Could Soothe Microsoft's Silverlight Itch - AndroidGuys (blog)

    Published Sat, 06 Mar 2010 14:41:12 GMT+00:00 by
Print