<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:georss="http://www.georss.org/georss" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>phazed.com</title><link>http://phazed.com/</link><description>Random technological babblings</description><generator>Graffiti CMS 1.2 (build 1.2.0.1451)</generator><lastBuildDate>Mon, 15 Jun 2009 10:26:57 GMT</lastBuildDate><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Phazed" type="application/rss+xml" /><feedburner:emailServiceId>Phazed</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Check your INI file encoding</title><link>http://feedproxy.google.com/~r/Phazed/~3/ILPI2mtZqss/</link><pubDate>Mon, 15 Jun 2009 10:26:57 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/check-your-ini-file-encoding/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;Last week I was assisting a customer with a production problem that appeared to be caused by the CLR JIT compiler &lt;a href="http://en.wikipedia.org/wiki/Inlining"&gt;inlining&lt;/a&gt; certain properties and methods. One of the quick workarounds we tried was to temporarily turn off JIT optimizations to see if it was indeed the inlining causing the problem. We did this using the &lt;a href="http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx"&gt;.NET Framework Debugging Control INI file&lt;/a&gt;.&lt;/p&gt;   &lt;p&gt;I got out Visual Studio, created a new text file, called it the same name as our EXE, but with an INI extension, and added the following to the file:&lt;/p&gt;  &lt;pre class="code"&gt;[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0&lt;/pre&gt;

&lt;p&gt;Then I saved the file and copied it to the same directory as our EXE, and restarted the application.&lt;/p&gt;

&lt;p&gt;The strange thing was that it had no effect whatsoever! Still our problem was there, and we were convinced by this point that it was the JIT inlining. I even went to the lengths of putting together a quick sample application that reproduced our problem and still this INI file wasn’t working.&lt;/p&gt;

&lt;p&gt;After over an hour banging our heads on our collective desks I started getting paranoid about the precise text in the INI file, and that’s when it dawned on me. The default encoding of text files in Visual Studio is UTF-8 with a signature. A quick check of the advanced save options confirmed this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/CheckyourINIfileencoding_9C55/image3.png"&gt;&lt;img style="display: inline" title="Advanced Save Options" alt="Advanced Save Options" src="http://phazed.com/files/media/image/WindowsLiveWriter/CheckyourINIfileencoding_9C55/image3_thumb.png" width="473" height="241" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Flipping this over to Windows codepage 1252 and resaving the file solved the problem. No more JIT optimizations and our problem disappears, finally confirming our suspicions.&lt;/p&gt;

&lt;p&gt;So it would seem that &lt;a href="http://msdn.microsoft.com/en-us/library/ms724353%28VS.85%29.aspx"&gt;GetPrivateProfileString&lt;/a&gt; doesn’t like Unicode &lt;a href="http://en.wikipedia.org/wiki/Byte-order_mark"&gt;byte order mark&lt;/a&gt; signatures!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uagYcujP4K137JdUQQeTvXU8HkA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uagYcujP4K137JdUQQeTvXU8HkA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uagYcujP4K137JdUQQeTvXU8HkA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uagYcujP4K137JdUQQeTvXU8HkA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ILPI2mtZqss:CwqhAwYcdew:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ILPI2mtZqss:CwqhAwYcdew:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=ILPI2mtZqss:CwqhAwYcdew:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ILPI2mtZqss:CwqhAwYcdew:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=ILPI2mtZqss:CwqhAwYcdew:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ILPI2mtZqss:CwqhAwYcdew:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ILPI2mtZqss:CwqhAwYcdew:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=ILPI2mtZqss:CwqhAwYcdew:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/ILPI2mtZqss" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/check-your-ini-file-encoding/</feedburner:origLink></item><item><title>Unity and the Factory Method Pattern</title><link>http://feedproxy.google.com/~r/Phazed/~3/ylT8YdUpogk/</link><pubDate>Thu, 23 Apr 2009 20:13:34 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/unity-and-the-factory-method-pattern/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>2</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;I’ve been playing around with &lt;a title="Unity" href="http://unity.codeplex.com/"&gt;Unity&lt;/a&gt; recently, and in particular I’ve been trying to get Unity to resolve dependencies from factory methods, and more specifically manage the lifetime of those dependencies. If you’re not familiar with the factory method pattern then check out &lt;a title="Wikipedia - Factory method pattern" href="http://en.wikipedia.org/wiki/Factory_method_pattern"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Out of the box, Unity does support the ability to register a type that is created by a factory method using the StaticFactoryExtension class. This extension allows you to specify a delegate that creates the type, and that delegate can then call a static factory method, or even resolve another type from the container and call it’s factory method. I’m not going to cover the specifics of how to use the StaticFactoryExtension here, but pop on over to &lt;a title="David Hayden&amp;#39;s Blog" href="http://www.davidhayden.com/blog.aspx"&gt;David Hayden&lt;/a&gt;’s blog for an &lt;a title="Unity StaticFactoryExtension - Registering FactoryDelegate to Create Object" href="http://davidhayden.com/blog/dave/archive/2009/02/08/UnityStaticFactoryExtensionRegisteringFactoryDelegateCreateObject.aspx"&gt;example&lt;/a&gt;.&lt;/p&gt;   &lt;p&gt;However, there’s a big drawback with the StaticFactoryExtension. It doesn’t allow you to specify any LifetimeManager, nor any InjectionMembers. This means that every time the factory method type is needed by a dependency, the factory method delegate is called. So you’re either forced to make your factory method manage object lifetimes, which isn’t nice, or put up with always having a new instance for every dependency. The lack of InjectionMembers also means that the factory method has to provide precisely the correctly configured object. This isn’t much of an issue for most factory methods, but it does provide more flexibility.&lt;/p&gt;  &lt;p&gt;So, what’s the solution? Well, I was pretty sure that it was going to require me to write some kind of Unity extension, and whilst I’m comfortable with using Unity, I’d not tried writing an extension before, other than a LifetimeManager. Unfortunately for me this requires you to know a bit about how ObjectBuilder works, and that’s not a particularly well documented bit of Unity. So, armed with the Unity source I started digging. What follows is the result.&lt;/p&gt;  &lt;p&gt;One of the first things I realized is that all I really need to do is modify the way that Unity builds objects at the stage where a specific constructor is called, and instead call a delegate to get the object instance. Everything else should stay the same. After a bit of digging I came across the UnityDefaultStrategiesExtension class, and in it’s Initialize method are the lines:&lt;/p&gt;  &lt;pre class="code"&gt;Context.BuildPlanStrategies.AddNew&amp;lt;&lt;span style="color: #2b91af"&gt;DynamicMethodConstructorStrategy&lt;/span&gt;&amp;gt;(
    &lt;span style="color: #2b91af"&gt;UnityBuildStage&lt;/span&gt;.Creation);
Context.BuildPlanStrategies.AddNew&amp;lt;&lt;span style="color: #2b91af"&gt;DynamicMethodPropertySetterStrategy&lt;/span&gt;&amp;gt;(
    &lt;span style="color: #2b91af"&gt;UnityBuildStage&lt;/span&gt;.Initialization);
Context.BuildPlanStrategies.AddNew&amp;lt;&lt;span style="color: #2b91af"&gt;DynamicMethodCallStrategy&lt;/span&gt;&amp;gt;(
    &lt;span style="color: #2b91af"&gt;UnityBuildStage&lt;/span&gt;.Initialization);&lt;/pre&gt;

&lt;p&gt;The bit that caught my eye was the DynamicMethodConstructorStrategy class. Looking in more detail at this class confirmed that it was responsible for generating part of a dynamic method that would actually call a constructor. This was the class I had to intercept and modify its behaviour. With this knowledge I started building my new extension, using the StaticFactoryExtension as an example.&lt;/p&gt;

&lt;p&gt;First I defined how I wanted to configure the extension in an interface. This interface has the same method signatures that you see on IUnityContainer for the generic versions of RegisterType, just naming them RegisterFactory and excluding the ones that take a TTo type parameter. You could quite easily add the non-generic versions too, but I didn’t bother.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public delegate object &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;IUnityContainer &lt;/span&gt;container);

&lt;span style="color: blue"&gt;public interface &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IUnityContainerExtensionConfigurator
&lt;/span&gt;{
    &lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                   &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers);

    &lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                   &lt;span style="color: blue"&gt;string &lt;/span&gt;name,
                                                   &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers);

    &lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                   &lt;span style="color: #2b91af"&gt;LifetimeManager &lt;/span&gt;lifetimeManager,
                                                   &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers);

    &lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                   &lt;span style="color: blue"&gt;string &lt;/span&gt;name,
                                                   &lt;span style="color: #2b91af"&gt;LifetimeManager &lt;/span&gt;lifetimeManager,
                                                   &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers);
}&lt;/pre&gt;

&lt;p&gt;Next, I defined the extension class by deriving from UnityContainerExtension and implementing the configuration interface.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;UnityContainerExtension&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                          &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(factoryMethodDelegate, &lt;span style="color: blue"&gt;null&lt;/span&gt;, &lt;span style="color: blue"&gt;null&lt;/span&gt;, injectionMembers);
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                          &lt;span style="color: blue"&gt;string &lt;/span&gt;name,
                                                          &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(factoryMethodDelegate, name, &lt;span style="color: blue"&gt;null&lt;/span&gt;, injectionMembers);
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                          &lt;span style="color: #2b91af"&gt;LifetimeManager &lt;/span&gt;lifetimeManager,
                                                          &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers)
    {
        &lt;span style="color: blue"&gt;return &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(factoryMethodDelegate, &lt;span style="color: blue"&gt;null&lt;/span&gt;, lifetimeManager, injectionMembers);
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration &lt;/span&gt;RegisterFactory&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodDelegate &lt;/span&gt;factoryMethodDelegate,
                                                          &lt;span style="color: blue"&gt;string &lt;/span&gt;name,
                                                          &lt;span style="color: #2b91af"&gt;LifetimeManager &lt;/span&gt;lifetimeManager,
                                                          &lt;span style="color: blue"&gt;params &lt;/span&gt;&lt;span style="color: #2b91af"&gt;InjectionMember&lt;/span&gt;[] injectionMembers)
    {
        Container.RegisterType&amp;lt;T&amp;gt;(name, lifetimeManager, injectionMembers);
        Context.Policies.Set&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodPolicy&lt;/span&gt;&amp;gt;(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodPolicy&lt;/span&gt;(() =&amp;gt; factoryMethodDelegate(Container)),
                                                   &lt;span style="color: #2b91af"&gt;NamedTypeBuildKey&lt;/span&gt;.Make&amp;lt;T&amp;gt;(name));
        &lt;span style="color: blue"&gt;return this&lt;/span&gt;;
    }

    &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;Initialize()
    {
        Context.BuildPlanStrategies.Clear();
        Context.BuildPlanStrategies.AddNew&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodConstructorStrategy&lt;/span&gt;&amp;gt;(&lt;span style="color: #2b91af"&gt;UnityBuildStage&lt;/span&gt;.Creation);
        Context.BuildPlanStrategies.AddNew&amp;lt;&lt;span style="color: #2b91af"&gt;DynamicMethodPropertySetterStrategy&lt;/span&gt;&amp;gt;(&lt;span style="color: #2b91af"&gt;UnityBuildStage&lt;/span&gt;.Initialization);
        Context.BuildPlanStrategies.AddNew&amp;lt;&lt;span style="color: #2b91af"&gt;DynamicMethodCallStrategy&lt;/span&gt;&amp;gt;(&lt;span style="color: #2b91af"&gt;UnityBuildStage&lt;/span&gt;.Initialization);
    }
}&lt;/pre&gt;

&lt;p&gt;The two important pieces here are the Initialize method and the last RegisterFactory method. In Initialize I’m getting rid of the default BuildPlanStrategies and replacing them for my own. Actually, the only difference between these and the defaults defined in UnityDefaultStrategiesExtension is the FactoryMethodConstructorStrategy used in the creation stage, but I’ll come to that later.&lt;/p&gt;

&lt;p&gt;In the last RegisterFactory method I register the from type as normal with the container, passing the LifetimeManager and InjectionMembers, but I also set an additional policy, IFactoryMethodPolicy, on the context. This wraps up the factory method delegate with the container into a more simple delegate that just returns an object, and is keyed using the same key that identifies the from type. This policy is used later when I need to call the factory delegate as part of building up the object. The FactoryMethodPolicy class is quite simple and just wraps the simplified delegate.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public delegate object &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate&lt;/span&gt;();

&lt;span style="color: blue"&gt;public interface &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IFactoryMethodPolicy &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IBuilderPolicy
&lt;/span&gt;{
    &lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate &lt;/span&gt;FactoryMethodPolicyDelegate { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }
}

&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodPolicy &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IFactoryMethodPolicy
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate &lt;/span&gt;factoryMethodPolicyDelegate;

    &lt;span style="color: blue"&gt;public &lt;/span&gt;FactoryMethodPolicy(&lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate &lt;/span&gt;factoryMethodPolicyDelegate)
    {
        &lt;span style="color: blue"&gt;this&lt;/span&gt;.factoryMethodPolicyDelegate = factoryMethodPolicyDelegate;
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate &lt;/span&gt;FactoryMethodPolicyDelegate
    {
        &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;factoryMethodPolicyDelegate; }
    }
}&lt;/pre&gt;

&lt;p&gt;The final link in the chain is the FactoryMethodConstructorStrategy class.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodConstructorStrategy &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;DynamicMethodConstructorStrategy
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private static readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MethodInfo &lt;/span&gt;FactoryMethodPolicyDelegateInvoke =
        &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate&lt;/span&gt;).GetMethod(&lt;span style="color: #a31515"&gt;&amp;quot;Invoke&amp;quot;&lt;/span&gt;);

    &lt;span style="color: blue"&gt;private static readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MethodInfo &lt;/span&gt;GetFactoryMethodPolicyDelegateMethodInfo =
        &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;FactoryMethodConstructorStrategy&lt;/span&gt;).GetMethod(&lt;span style="color: #a31515"&gt;&amp;quot;GetFactoryMethodPolicyDelegate&amp;quot;&lt;/span&gt;);

    &lt;span style="color: blue"&gt;public override void &lt;/span&gt;PreBuildUp(&lt;span style="color: #2b91af"&gt;IBuilderContext &lt;/span&gt;context)
    {
        &lt;span style="color: #2b91af"&gt;Guard&lt;/span&gt;.ArgumentNotNull(context, &lt;span style="color: #a31515"&gt;&amp;quot;context&amp;quot;&lt;/span&gt;);
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(GetFactoryMethodPolicyDelegate(context) == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        {
            &lt;span style="color: blue"&gt;base&lt;/span&gt;.PreBuildUp(context);
            &lt;span style="color: blue"&gt;return&lt;/span&gt;;
        }
        &lt;span style="color: blue"&gt;var &lt;/span&gt;buildContext = (&lt;span style="color: #2b91af"&gt;DynamicBuildPlanGenerationContext&lt;/span&gt;)context.Existing;
        &lt;span style="color: #2b91af"&gt;Label &lt;/span&gt;existingObjectNotNull = buildContext.IL.DefineLabel();
        buildContext.EmitLoadExisting();
        buildContext.IL.Emit(&lt;span style="color: #2b91af"&gt;OpCodes&lt;/span&gt;.Brtrue, existingObjectNotNull);
        buildContext.EmitLoadContext();
        buildContext.IL.EmitCall(&lt;span style="color: #2b91af"&gt;OpCodes&lt;/span&gt;.Call, GetFactoryMethodPolicyDelegateMethodInfo, &lt;span style="color: blue"&gt;null&lt;/span&gt;);
        buildContext.IL.EmitCall(&lt;span style="color: #2b91af"&gt;OpCodes&lt;/span&gt;.Callvirt, FactoryMethodPolicyDelegateInvoke, &lt;span style="color: blue"&gt;null&lt;/span&gt;);
        buildContext.EmitStoreExisting();
        buildContext.IL.MarkLabel(existingObjectNotNull);
    }

    &lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodPolicyDelegate &lt;/span&gt;GetFactoryMethodPolicyDelegate(&lt;span style="color: #2b91af"&gt;IBuilderContext &lt;/span&gt;context)
    {
        &lt;span style="color: blue"&gt;var &lt;/span&gt;factoryMethodPolicy = context.Policies.Get&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodPolicy&lt;/span&gt;&amp;gt;(context.BuildKey);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;factoryMethodPolicy == &lt;span style="color: blue"&gt;null &lt;/span&gt;? &lt;span style="color: blue"&gt;null &lt;/span&gt;: factoryMethodPolicy.FactoryMethodPolicyDelegate;
    }
}&lt;/pre&gt;
This class derives from the original DynamicMethodConstructorStrategy class whose behaviour I want to modify. I override the PreBuildUp method and check to see if there is an IFactoryMethodPolicy with a delegate defined for the build key in the context. If there isn’t I simply call the base implementation of PreBuildUp that will generate the dynamic method bits to call a constructor. However, if there is a delegate defined then I generate the dynamic method bits that call this delegate. 

&lt;p&gt;And once it’s all put together, that’s it! For good measure I’ve included the tests I used below. I’m certainly finding this useful in my projects, and if you do too I’d really like to hear about your experiences. Please feel free to comment on this post, even if it’s a bug you find!&lt;/p&gt;

&lt;pre class="code"&gt; [&lt;span style="color: #2b91af"&gt;TestFixture&lt;/span&gt;]
 &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtensionTests
 &lt;/span&gt;{
     &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TestStringFactory
     &lt;/span&gt;{
         &lt;span style="color: blue"&gt;private readonly string &lt;/span&gt;factory;

         &lt;span style="color: blue"&gt;public &lt;/span&gt;TestStringFactory(&lt;span style="color: blue"&gt;string &lt;/span&gt;factory)
         {
             &lt;span style="color: blue"&gt;this&lt;/span&gt;.factory = factory;
         }

         &lt;span style="color: blue"&gt;public string &lt;/span&gt;GetString()
         {
             &lt;span style="color: blue"&gt;return &lt;/span&gt;factory;
         }
     }

     &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TestStringDependency
     &lt;/span&gt;{
         &lt;span style="color: blue"&gt;private readonly string &lt;/span&gt;dependency;

         &lt;span style="color: blue"&gt;public &lt;/span&gt;TestStringDependency(&lt;span style="color: blue"&gt;string &lt;/span&gt;dependency)
         {
             &lt;span style="color: blue"&gt;this&lt;/span&gt;.dependency = dependency;
         }

         &lt;span style="color: blue"&gt;public string &lt;/span&gt;Dependency
         {
             &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;dependency; }
         }
     }

     [&lt;span style="color: #2b91af"&gt;Test&lt;/span&gt;]
     &lt;span style="color: blue"&gt;public void &lt;/span&gt;FactoryMethodCanBeUsedToResolveTypeDependency()
     {
         &lt;span style="color: blue"&gt;var &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
         container.AddNewExtension&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension&lt;/span&gt;&amp;gt;();
         container.Configure&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration&lt;/span&gt;&amp;gt;()
             .RegisterFactory&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(c =&amp;gt; &lt;span style="color: #a31515"&gt;&amp;quot;FactoryString&amp;quot;&lt;/span&gt;);
         container.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;TestStringDependency&lt;/span&gt;&amp;gt;();

         &lt;span style="color: blue"&gt;var &lt;/span&gt;resolve = container.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;TestStringDependency&lt;/span&gt;&amp;gt;();

         &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: #a31515"&gt;&amp;quot;FactoryString&amp;quot;&lt;/span&gt;, resolve.Dependency);
     }

     [&lt;span style="color: #2b91af"&gt;Test&lt;/span&gt;]
     &lt;span style="color: blue"&gt;public void &lt;/span&gt;FactoryMethodCanUseContainerToResolveTypeToGetFactoryMethodUsedInDependency()
     {
         &lt;span style="color: blue"&gt;var &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
         container.AddNewExtension&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension&lt;/span&gt;&amp;gt;();
         container.RegisterInstance(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TestStringFactory&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;FactoryString&amp;quot;&lt;/span&gt;));
         container.Configure&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration&lt;/span&gt;&amp;gt;()
             .RegisterFactory&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(c =&amp;gt; c.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;TestStringFactory&lt;/span&gt;&amp;gt;().GetString());
         container.RegisterType&amp;lt;&lt;span style="color: #2b91af"&gt;TestStringDependency&lt;/span&gt;&amp;gt;();

         &lt;span style="color: blue"&gt;var &lt;/span&gt;resolve = container.Resolve&amp;lt;&lt;span style="color: #2b91af"&gt;TestStringDependency&lt;/span&gt;&amp;gt;();

         &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreEqual(&lt;span style="color: #a31515"&gt;&amp;quot;FactoryString&amp;quot;&lt;/span&gt;, resolve.Dependency);
     }

     [&lt;span style="color: #2b91af"&gt;Test&lt;/span&gt;]
     &lt;span style="color: blue"&gt;public void &lt;/span&gt;FactoryMethodExtensionLoadedStillResolvesNormally()
     {
         &lt;span style="color: blue"&gt;var &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
         container.AddNewExtension&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension&lt;/span&gt;&amp;gt;();
         container.RegisterType&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();

         &lt;span style="color: blue"&gt;var &lt;/span&gt;resolve = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();

         &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.NotNull(resolve);
     }

     [&lt;span style="color: #2b91af"&gt;Test&lt;/span&gt;]
     &lt;span style="color: blue"&gt;public void &lt;/span&gt;FactoryMethodExtensionWithContainerLifetimeResolvesSameInstances()
     {
         &lt;span style="color: blue"&gt;var &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
         container.AddNewExtension&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension&lt;/span&gt;&amp;gt;();
         container.Configure&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration&lt;/span&gt;&amp;gt;()
             .RegisterFactory&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;(c =&amp;gt; &lt;span style="color: blue"&gt;new object&lt;/span&gt;(), &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ContainerControlledLifetimeManager&lt;/span&gt;());

         &lt;span style="color: blue"&gt;var &lt;/span&gt;first = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();
         &lt;span style="color: blue"&gt;var &lt;/span&gt;second = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();

         &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreSame(first, second);
     }

     [&lt;span style="color: #2b91af"&gt;Test&lt;/span&gt;]
     &lt;span style="color: blue"&gt;public void &lt;/span&gt;FactoryMethodExtensionWithDefaultLifetimeResolvesDifferentInstances()
     {
         &lt;span style="color: blue"&gt;var &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
         container.AddNewExtension&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension&lt;/span&gt;&amp;gt;();
         container.Configure&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration&lt;/span&gt;&amp;gt;()
             .RegisterFactory&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;(c =&amp;gt; &lt;span style="color: blue"&gt;new object&lt;/span&gt;());

         &lt;span style="color: blue"&gt;var &lt;/span&gt;first = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();
         &lt;span style="color: blue"&gt;var &lt;/span&gt;second = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();

         &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreNotSame(first, second);
     }

     [&lt;span style="color: #2b91af"&gt;Test&lt;/span&gt;]
     &lt;span style="color: blue"&gt;public void &lt;/span&gt;FactoryMethodExtensionWithTransientLifetimeResolvesDifferentInstances()
     {
         &lt;span style="color: blue"&gt;var &lt;/span&gt;container = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;UnityContainer&lt;/span&gt;();
         container.AddNewExtension&amp;lt;&lt;span style="color: #2b91af"&gt;FactoryMethodExtension&lt;/span&gt;&amp;gt;();
         container.Configure&amp;lt;&lt;span style="color: #2b91af"&gt;IFactoryMethodConfiguration&lt;/span&gt;&amp;gt;()
             .RegisterFactory&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;(c =&amp;gt; &lt;span style="color: blue"&gt;new object&lt;/span&gt;(), &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TransientLifetimeManager&lt;/span&gt;());

         &lt;span style="color: blue"&gt;var &lt;/span&gt;first = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();
         &lt;span style="color: blue"&gt;var &lt;/span&gt;second = container.Resolve&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;();

         &lt;span style="color: #2b91af"&gt;Assert&lt;/span&gt;.AreNotSame(first, second);
     }
}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/csWG6q3P9HVK3qlGb3JrtBYMatE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/csWG6q3P9HVK3qlGb3JrtBYMatE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/csWG6q3P9HVK3qlGb3JrtBYMatE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/csWG6q3P9HVK3qlGb3JrtBYMatE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ylT8YdUpogk:aOPRdakgq_U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ylT8YdUpogk:aOPRdakgq_U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=ylT8YdUpogk:aOPRdakgq_U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ylT8YdUpogk:aOPRdakgq_U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=ylT8YdUpogk:aOPRdakgq_U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ylT8YdUpogk:aOPRdakgq_U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=ylT8YdUpogk:aOPRdakgq_U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=ylT8YdUpogk:aOPRdakgq_U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/ylT8YdUpogk" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/unity-and-the-factory-method-pattern/</feedburner:origLink></item><item><title>Feature Jealousy</title><link>http://feedproxy.google.com/~r/Phazed/~3/fj0iqYqHnoA/</link><pubDate>Wed, 25 Mar 2009 14:43:06 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/feature-jealousy/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;What’s got LINQ, but doesn’t have a &lt;a title="yield (C# reference)" href="http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx"&gt;yield&lt;/a&gt; keyword and no &lt;a title="Action Delegate" href="http://msdn.microsoft.com/en-us/library/018hxwa8.aspx"&gt;Action&lt;/a&gt; or multiline lambdas? What’s supposed to be an easy to learn language, but supports &lt;a title="Exception Filters" href="http://blogs.msdn.com/clrteam/archive/2009/02/05/catch-rethrow-and-filters-why-you-should-care.aspx"&gt;exception filters&lt;/a&gt; when other supposedly more complex languages don’t?&lt;/p&gt;  &lt;p&gt;The answer, VB.NET.&lt;/p&gt;  &lt;p&gt;“Co-evolution” has been &lt;a title="Co-evolution announced" href="http://blogs.msdn.com/ericnel/archive/2008/12/11/new-technical-article-on-visual-studio-2010-language-futures.aspx"&gt;announced&lt;/a&gt; for VB.NET 10.0 and C# 4.0. However, VB.NET doesn’t appear to be getting yield, and C# won’t be getting XML literals (which I personally think is a good thing).&lt;/p&gt;  &lt;p&gt;I think VB.NET shed the “Beginners” bit from &lt;a title="BASIC on Wikipedia" href="http://en.wikipedia.org/wiki/BASIC"&gt;BASIC&lt;/a&gt; a long time ago. What do you think?&lt;/p&gt; Oh, and whilst I’m at it, who’s up for an __il keyword in C# so you can have &lt;a title="Inline Assembler in C++" href="http://msdn.microsoft.com/en-us/library/45yd4tzz%28VS.80%29.aspx"&gt;inline blocks of IL&lt;/a&gt;?
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-zxhyBqRXl5e4CIvI2h-khSY0rE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-zxhyBqRXl5e4CIvI2h-khSY0rE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-zxhyBqRXl5e4CIvI2h-khSY0rE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-zxhyBqRXl5e4CIvI2h-khSY0rE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=fj0iqYqHnoA:i3_bsN3p2WA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=fj0iqYqHnoA:i3_bsN3p2WA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=fj0iqYqHnoA:i3_bsN3p2WA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=fj0iqYqHnoA:i3_bsN3p2WA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=fj0iqYqHnoA:i3_bsN3p2WA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=fj0iqYqHnoA:i3_bsN3p2WA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=fj0iqYqHnoA:i3_bsN3p2WA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=fj0iqYqHnoA:i3_bsN3p2WA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/fj0iqYqHnoA" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/feature-jealousy/</feedburner:origLink></item><item><title>Be afraid?</title><link>http://feedproxy.google.com/~r/Phazed/~3/nnEyMroMVJI/</link><pubDate>Wed, 25 Mar 2009 10:09:15 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/be-afraid/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;According to the BBC this morning, the UK government is proposing to &lt;a title="Social network sites &amp;#39;monitored&amp;#39;" href="http://news.bbc.co.uk/1/hi/uk/7962631.stm"&gt;monitor social networking sites&lt;/a&gt; like &lt;a title="Facebook" href="http://www.facebook.com/"&gt;Facebook&lt;/a&gt;, &lt;a title="Bebo" href="http://www.bebo.com/"&gt;Bebo&lt;/a&gt; and &lt;a title="MySpace" href="http://www.myspace.com/"&gt;MySpace&lt;/a&gt;. This comes the day after a report called for the government to &lt;a title="Call to scrap &amp;#39;illegal databases&amp;#39;" href="http://news.bbc.co.uk/1/hi/uk/7955205.stm"&gt;scrap a quarter of all their databases&lt;/a&gt; as they are illegal and should be redesigned. Included in this list of databases is the Communications Database which plans to centralise details of all phone calls made and websites visited, and is open to 510 public authorities. Just imagine what you could find out about people with a bit of clever data mining across these databases. What about joining up &lt;a title="Google Street View and the Terrorism Act" href="http://www.jamessnape.me.uk/blog/2009/03/20/GoogleStreetViewAndSection58OfTheTerrorismAct2000.aspx"&gt;other sources of information&lt;/a&gt; on the internet? What sort of information would you look up about yourself, friends or family? How would that differ from the sort of information that government departments or security services would want to look up? People are always curious about what other people are interested in.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4-_P-8Vx0dkZWpeJjcKcL75wDCg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4-_P-8Vx0dkZWpeJjcKcL75wDCg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4-_P-8Vx0dkZWpeJjcKcL75wDCg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4-_P-8Vx0dkZWpeJjcKcL75wDCg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=nnEyMroMVJI:qaJpwZV3tQM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=nnEyMroMVJI:qaJpwZV3tQM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=nnEyMroMVJI:qaJpwZV3tQM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=nnEyMroMVJI:qaJpwZV3tQM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=nnEyMroMVJI:qaJpwZV3tQM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=nnEyMroMVJI:qaJpwZV3tQM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/Phazed?a=nnEyMroMVJI:qaJpwZV3tQM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/Phazed?i=nnEyMroMVJI:qaJpwZV3tQM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/nnEyMroMVJI" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/be-afraid/</feedburner:origLink></item><item><title>Flexible Enumerations</title><link>http://feedproxy.google.com/~r/Phazed/~3/lojYeY0QZYs/</link><pubDate>Wed, 04 Feb 2009 20:40:27 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/flexible-enumerations/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>7</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;Sometimes enumerations in .NET just don’t cut it. In the end they’re just a numeric value to which a piece of string metadata is attached to some of the values. Consider the following enumerations:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public enum &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocationNames
&lt;/span&gt;{
    London,
    Edinburgh,
    Redmond
}

&lt;span style="color: blue"&gt;public enum &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocationCodes
&lt;/span&gt;{
    LON,
    EDI,
    RED
}&lt;/pre&gt;

&lt;p&gt;What are these enumerations actually trying to say? I see these and think that there are three office locations, London, Edinburgh and Redmond, and each has a name and a three letter code, i.e. one type of thing, an office location, with two pieces of descriptive information about that thing, name and code. But using enumerations has forced us to define two things, when it’s really one. So what solutions are there?&lt;/p&gt;

&lt;p&gt;Here’s one solution I like. I’m sure there are more, so feel free to suggest variations or completely different patterns in the comments. First off I define an interface, IOfficeLocation, to specify what makes up an office location:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public interface &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IOfficeLocation
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;string &lt;/span&gt;Code { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }
    &lt;span style="color: blue"&gt;string &lt;/span&gt;Name { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }
    &lt;span style="color: blue"&gt;double &lt;/span&gt;Latitude { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }
    &lt;span style="color: blue"&gt;double &lt;/span&gt;Longitude { &lt;span style="color: blue"&gt;get&lt;/span&gt;; }
}&lt;/pre&gt;

&lt;p&gt;I’ve taken the liberty of adding two more pieces of descriptive information to the office location too, latitude and longitude, just to prove the point. Note that this is &lt;a title="immutable" href="http://en.wikipedia.org/wiki/Immutable_object"&gt;immutable&lt;/a&gt;, i.e. you can’t change the values once they’ve been created.&lt;/p&gt;

&lt;p&gt;Next, I define the OfficeLocations static class that will be our container for the three possible office locations. Inside this class I define the OfficeLocation class, which is a concrete implementation of the IOfficeLocation interface. Again, this class is &lt;a title="immutable" href="http://en.wikipedia.org/wiki/Immutable_object"&gt;immutable&lt;/a&gt;, and importantly it’s a private class to the OfficeLocations static class. This ensures that only the OfficeLocations class can construct instances of the OfficeLocation class. Finally I define the three office locations as static read-only fields of the OfficeLocations class, all using the IOfficeLocation interface, but constructed from the private OfficeLocation class.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocations
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocation &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IOfficeLocation
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;private readonly string &lt;/span&gt;code;

        &lt;span style="color: blue"&gt;public &lt;/span&gt;OfficeLocation(&lt;span style="color: blue"&gt;string &lt;/span&gt;code, &lt;span style="color: blue"&gt;string &lt;/span&gt;name, &lt;span style="color: blue"&gt;double &lt;/span&gt;latitude, &lt;span style="color: blue"&gt;double &lt;/span&gt;longitude)
        {
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.code = code;
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.name = name;
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.latitude = latitude;
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.longitude = longitude;
        }

        &lt;span style="color: blue"&gt;private readonly string &lt;/span&gt;name;

        &lt;span style="color: blue"&gt;private readonly double &lt;/span&gt;latitude;

        &lt;span style="color: blue"&gt;private readonly double &lt;/span&gt;longitude;

        &lt;span style="color: blue"&gt;public string &lt;/span&gt;Code
        {
            &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;code; }
        }

        &lt;span style="color: blue"&gt;public string &lt;/span&gt;Name
        {
            &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;name; }
        }

        &lt;span style="color: blue"&gt;public double &lt;/span&gt;Latitude
        {
            &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;latitude; }
        }

        &lt;span style="color: blue"&gt;public double &lt;/span&gt;Longitude
        {
            &lt;span style="color: blue"&gt;get &lt;/span&gt;{ &lt;span style="color: blue"&gt;return &lt;/span&gt;longitude; }
        }
    }

    &lt;span style="color: blue"&gt;public static readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IOfficeLocation &lt;/span&gt;London = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocation&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;LON&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;London&amp;quot;&lt;/span&gt;, 0d, 0d);
    &lt;span style="color: blue"&gt;public static readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IOfficeLocation &lt;/span&gt;Edinburgh = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocation&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;EDI&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;Edinburgh&amp;quot;&lt;/span&gt;, 0d, 0d);
    &lt;span style="color: blue"&gt;public static readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IOfficeLocation &lt;/span&gt;Redmond = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OfficeLocation&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;MAN&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;Manchester&amp;quot;&lt;/span&gt;, 0d, 0d);
}&lt;/pre&gt;

&lt;p&gt;Using the OfficeLocations class is very similar to an enumeration, and because there is only ever one instance of London, Edinburgh and Redmond I can test for equality without needing to override the Equals method in the OfficeLocation class. I also like the fact that I cannot do more than or less than comparisons against office locations. It doesn’t make sense, to see if London is more than Edinburgh, does it? However, if it did I could implement IComparable on OfficeLocation and then I could make those comparisons.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public bool &lt;/span&gt;IsInUnitedKingdom(&lt;span style="color: #2b91af"&gt;IOfficeLocation &lt;/span&gt;location)
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;(location == &lt;span style="color: #2b91af"&gt;OfficeLocations&lt;/span&gt;.London) || (location == &lt;span style="color: #2b91af"&gt;OfficeLocations&lt;/span&gt;.Edinburgh);
}&lt;/pre&gt;

&lt;p&gt;So, as usual, comments are always welcome. Are there any variations on this theme? Or perhaps issues with this implementation? Surely not!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Q-tcRjWNpJZIDIKlKZwL3A85kp4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q-tcRjWNpJZIDIKlKZwL3A85kp4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Q-tcRjWNpJZIDIKlKZwL3A85kp4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q-tcRjWNpJZIDIKlKZwL3A85kp4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Phazed?a=ISnSE39E"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=yyBz3Icq"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=yyBz3Icq" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=DXBp6cpk"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=DXBp6cpk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=Jlm1V5X7"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=kiKHrZWd"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=kiKHrZWd" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/lojYeY0QZYs" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/flexible-enumerations/</feedburner:origLink></item><item><title>Snow Fun</title><link>http://feedproxy.google.com/~r/Phazed/~3/JBn8zw3ji_o/</link><pubDate>Tue, 03 Feb 2009 16:10:03 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/snow-fun/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;Well it won’t have escaped many readers from the UK (assuming I have readers outside the UK!) that it’s been snowing here, &lt;a title="Snow causing further disruption" href="http://news.bbc.co.uk/1/hi/uk/7866294.stm"&gt;quite a bit more&lt;/a&gt; than it would normally for this time of year! So Joanne and I took Isaac out for his first experience of snow. He, of course, slept through the whole walk through &lt;a title="Lily Hill Park" href="http://www.bracknell-forest.gov.uk/leisure/leis-parks-and-countryside/leis-parks-and-countryside-sites/leis-lily-hill-park.htm"&gt;Lily Hill Park&lt;/a&gt;, but here’s the photos for posterity.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0031_2.jpg"&gt;&lt;img style="display: inline" title="Joanne and Isaac" alt="Joanne and Isaac" src="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0031_thumb.jpg" width="244" height="181" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0032_2.jpg"&gt;&lt;img style="display: inline" title="Joanne and Isaac" alt="Joanne and Isaac" src="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0032_thumb.jpg" width="244" height="183" /&gt;&lt;/a&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0033_2.jpg"&gt;&lt;img style="display: inline" title="Isaac in his parm" alt="Isaac in his parm" src="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0033_thumb.jpg" width="244" height="180" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And just for good measure, here’s a couple of shots I took this morning waiting for a train from &lt;a title="Martins Heron" href="http://en.wikipedia.org/wiki/Martins_Heron_railway_station"&gt;Martins Heron&lt;/a&gt; into London. I think the pink hue is due to the fact that cameras in mobile phones don’t have UV filters!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0034_2.jpg"&gt;&lt;img style="display: inline" title="Martins Heron train station in the snow" alt="Martins Heron train station in the snow" src="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0034_thumb.jpg" width="244" height="180" /&gt;&lt;/a&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0035_2.jpg"&gt;&lt;img style="display: inline" title="Martins Heron train station in the snow" alt="Martins Heron train station in the snow" src="http://phazed.com/files/media/image/WindowsLiveWriter/SnowFun_E33A/PIC-0035_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The train, by the way, did turn up on time, but arrived quite a bit late and was rammed full of people quite quickly. Obviously the &lt;a title="Wrong kind of snow" href="http://en.wikipedia.org/wiki/The_wrong_kind_of_snow"&gt;wrong kind of snow&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/flTj0Uc3p5nhQlbe_WZBF4GD5wE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/flTj0Uc3p5nhQlbe_WZBF4GD5wE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/flTj0Uc3p5nhQlbe_WZBF4GD5wE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/flTj0Uc3p5nhQlbe_WZBF4GD5wE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Phazed?a=K8RnOVoV"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=MB3foXz3"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=MB3foXz3" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=LcsfclQv"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=LcsfclQv" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=yyQP1HDg"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=5dU7tAYT"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=5dU7tAYT" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/JBn8zw3ji_o" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/snow-fun/</feedburner:origLink></item><item><title>And Can It Be…</title><link>http://feedproxy.google.com/~r/Phazed/~3/rDWnzmz2mTo/</link><pubDate>Tue, 03 Feb 2009 15:39:43 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/and-can-it-be-hellip/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;With apologies to &lt;a href="http://www.cyberhymnal.org/htm/a/c/acanitbe.htm"&gt;Charles Wesley&lt;/a&gt;.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;My chain fell off,      &lt;br /&gt;My bike ran free,       &lt;br /&gt;Rolled down the hill into that tree.       &lt;br /&gt;My chain fell off,       &lt;br /&gt;My bike ran free,       &lt;br /&gt;Rolled down the hill into that tree.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vAjVl7Of-86MzoMNz0PsloFaJRc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vAjVl7Of-86MzoMNz0PsloFaJRc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vAjVl7Of-86MzoMNz0PsloFaJRc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vAjVl7Of-86MzoMNz0PsloFaJRc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Phazed?a=BII1YWHw"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=oJrKIU5P"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=oJrKIU5P" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=qpsW37kG"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=qpsW37kG" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=qKNGmuq8"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=1DAKJQdb"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=1DAKJQdb" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/rDWnzmz2mTo" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/and-can-it-be-hellip/</feedburner:origLink></item><item><title>Isaac Michael Benbrook</title><link>http://feedproxy.google.com/~r/Phazed/~3/fF-rxMvN9H0/</link><pubDate>Wed, 14 Jan 2009 14:10:17 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/isaac-michael-benbrook/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>16</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;Joanne and I are pleased to announce that Isaac Michael Benbrook was born on the morning of Tuesday 13th January 2009 at 06:17, weighing 6lb 12oz. Both Mum and Isaac are doing really well, and needless to say we’re all deliriously happy!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/2007Aug11-0212.jpg"&gt;&lt;img style="display: inline" title="Joanne &amp;amp; Isaac" alt="Joanne &amp;amp; Isaac" src="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/2007Aug11-0212_thumb.jpg" width="244" height="183" /&gt;&lt;/a&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/2007Aug11-0215.jpg"&gt;&lt;img style="display: inline" title="Isaac" alt="Isaac" src="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/2007Aug11-0215_thumb.jpg" width="244" height="177" /&gt;&lt;/a&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/2007Aug11-0220.jpg"&gt;&lt;img style="display: inline" title="Isaac Sleeping" alt="Isaac Sleeping" src="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/2007Aug11-0220_thumb.jpg" width="184" height="244" /&gt;&lt;/a&gt;&lt;a href="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/IMG_1138.jpg"&gt;&lt;img style="display: inline" title="Joanne &amp;amp; Isaac" alt="Joanne &amp;amp; Isaac" src="http://phazed.com/files/media/image/WindowsLiveWriter/IsaacMichaelBenbrook_746F/IMG_1138_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nvNaiID4AnZJmTRqvQx_RlNJqHo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nvNaiID4AnZJmTRqvQx_RlNJqHo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nvNaiID4AnZJmTRqvQx_RlNJqHo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nvNaiID4AnZJmTRqvQx_RlNJqHo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Phazed?a=uhHhwWF6"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=R3Esk0rj"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=R3Esk0rj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=tk9Psrsf"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=tk9Psrsf" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=DAOnCwJf"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=fPKlnqjl"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=fPKlnqjl" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/fF-rxMvN9H0" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/isaac-michael-benbrook/</feedburner:origLink></item><item><title>BizTalk Functoid Memory Leaks</title><link>http://feedproxy.google.com/~r/Phazed/~3/ezmpzQ7FqgA/</link><pubDate>Thu, 11 Dec 2008 20:13:20 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/biztalk-functoid-memory-leaks/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;I hadn’t come across this one before, but buried in &lt;a href="http://support.microsoft.com/kb/918643"&gt;support article 918643&lt;/a&gt; about “How to troubleshoot a memory leak or an out-of-memory exception in the BizTalk Server process”, is the fact that some BizTalk mapper functiods leak memory. How much memory is dependent on the size of the assembly that contains the maps that use the leaky functiods. The leaky functiods are all the ones that are actually implemented using inline script in XSLT. The support article has a useful table that highlights which ones these are:&lt;/p&gt;   &lt;table&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;th&gt;Functoids&lt;/th&gt;        &lt;th&gt;Inline script?&lt;/th&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All String Functoids&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Mathematical Functoids&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Logical Functoids except IsNil&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Logical IsNil Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Date/Time Functoids&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Conversion Functoids&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Scientific Functoids&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Cumulative Functoids&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;All Database Functoids&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td colspan="2"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;th&gt;Advanced Functoids&lt;/th&gt;        &lt;th&gt;Inline script?&lt;/th&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Looping Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Value Mapping Flattening Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Assert Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Table Extractor Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Table Looping Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Scripting Functoid with Inline C#&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Scripting Functoid with Inline JScript.NET&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Scripting Functoid with Inline VB.NET&lt;/td&gt;        &lt;td&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Scripting Functoid with Inline XSLT&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Scripting Functoid with Inline XSLT Call Template&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Scripting Functoid calling External Assembly&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Nil Value Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Value Mapping Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Mass Copy Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Iteration Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Index Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Record Count Functoid&lt;/td&gt;        &lt;td&gt;No&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Now I have to say that I’m not that impressed by the suggested workaround which is to put all the maps in a small assembly on their own and reference them. That doesn’t stop the memory leak, it just slows it down!&lt;/p&gt;  &lt;p&gt;So how could you avoid the leak altogether? I’ve got a couple of suggestions. First your could try and rewrite your map in straight XSLT, without any inline script of course. Or, and this is not the simplest answer, you could just replace all the functoids that use inline script with a scripting functiod that calls an external assembly method, and then write that functiod operation in code.&lt;/p&gt;  &lt;p&gt;Any other suggestions?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eWL8tb5RGCbwhqaFujDfiN0shtU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eWL8tb5RGCbwhqaFujDfiN0shtU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eWL8tb5RGCbwhqaFujDfiN0shtU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eWL8tb5RGCbwhqaFujDfiN0shtU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Phazed?a=Xem3BRYH"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=wiXafxid"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=wiXafxid" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=VlpQsIuj"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=VlpQsIuj" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=y2XrrBAS"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=na666jMP"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=na666jMP" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/ezmpzQ7FqgA" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/biztalk-functoid-memory-leaks/</feedburner:origLink></item><item><title>More ReSharper Shortcuts</title><link>http://feedproxy.google.com/~r/Phazed/~3/bEwq_UannU4/</link><pubDate>Wed, 10 Dec 2008 10:13:39 GMT</pubDate><guid isPermaLink="false">http://phazed.com/blog/more-resharper-shortcuts/</guid><dc:creator>Rupert Benbrook</dc:creator><slash:comments>0</slash:comments><category domain="http://phazed.com/blog/">Blog</category><description>&lt;p&gt;First off, an apology. It’s been an age since I last posted. No excuses, I’ve just been &lt;span style="text-decoration: line-through"&gt;busy&lt;/span&gt; lazy.&lt;/p&gt;  &lt;p&gt;So, I happened to be working with my colleague &lt;a href="http://www.thejoyofcode.com"&gt;Josh Twist&lt;/a&gt; on a customer gig about &lt;a href="http://www.codeplex.com/CompositeWPF"&gt;Prism&lt;/a&gt; (that’s a different story) and I spotted during his demos that Josh had &lt;a href="http://www.jetbrains.com/resharper/"&gt;ReSharper&lt;/a&gt; installed. Now I’m a big fan of ReSharper, as both readers of this blog might have guessed and certainly my customers and colleagues know very well! Well, to cut a long story short &lt;a href="http://www.thejoyofcode.com/My_new_favourite_Resharper_features.aspx"&gt;I got him excited&lt;/a&gt; about some ReSharper shortcuts he hadn’t come across before, and hence he challenged me to blog about some more. So here goes. Before I forget, I’m using the ReSharper Visual Studio key bindings, not the IntelliJ ones.&lt;/p&gt;  &lt;h2&gt;Introduce variable&lt;/h2&gt;  &lt;p&gt;This one saves a whole lot of typing, even with the introduction of the &lt;a href="http://www.25hoursaday.com/weblog/2008/05/21/C30ImplicitTypeDeclarationsToVarOrNotToVar.aspx"&gt;controversial&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/bb383973.aspx"&gt;var&lt;/a&gt; &lt;a href="http://resharper.blogspot.com/2007/08/resharper-vs-c-30-implicitly-typed.html"&gt;keyword&lt;/a&gt;, but it does take a little getting used to. Let’s say that I want to new up a StringBuilder. Instead of thinking type (or var), variable, equals, new StringBuilder, I just think new StringBuilder. Leave the cursor at the end of the line and the light bulb appears. Hit Alt+Enter to show the hint menu:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Introduce variable menu" alt="Introduce variable menu" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_52.png" width="241" height="121" /&gt; &lt;/p&gt;  &lt;p&gt;Select Introduce variable and ReSharper will complete the type and the declaration, first giving the the choice of type:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Type menu" alt="Type menu" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_51.png" width="304" height="124" /&gt; &lt;/p&gt;  &lt;p&gt;Press Tab and it’ll move on to giving me a choice of variable name:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Variable name menu" alt="Variable name menu" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_50.png" width="314" height="122" /&gt; &lt;/p&gt;  &lt;p&gt;And finally Tab once more and the statement is complete.&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Introduce variable complete" alt="Introduce variable complete" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_49.png" width="309" height="118" /&gt; &lt;/p&gt;  &lt;h2&gt;Find Type&lt;/h2&gt;  &lt;p&gt;I use this one quite a bit when I navigating around an unfamiliar and large solution, and in particular when the code hasn’t kept to the best practice guideline of one class per file. Pressing Ctrl+T brings up the Find Type search box:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Find type" alt="Find type" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_48.png" width="336" height="54" /&gt; &lt;/p&gt;  &lt;p&gt;As I start typing type names it suggests types that match:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Typing type name" alt="Typing type name" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_47.png" width="336" height="81" /&gt; &lt;/p&gt;  &lt;p&gt;What’s really nice it is supports what ReSharper calls &lt;a href="http://blogs.jetbrains.com/dotnet/2008/02/resharper-in-detail-camelhumps/"&gt;CamelHumps&lt;/a&gt;. Essentially this means you only need to type the capitalized letters of a type, which is really useful if, like me, you like quite descriptive type names:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="CamelHumps searching" alt="CamelHumps searching" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_46.png" width="336" height="81" /&gt; &lt;/p&gt;  &lt;p&gt;By the way, there’s a similar version of this shortcut, Ctrl+Shift+T, that does the same thing but finds files instead:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Find files" alt="Find files" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_45.png" width="336" height="81" /&gt; &lt;/p&gt;  &lt;h2&gt;Move Up &amp;amp; Down&lt;/h2&gt;  &lt;p&gt;This is one for those who are picky about code layout. After all, the compiler doesn’t care about where stuff appears in the code, but I do! Take the case of this Person class:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Person class" alt="Person class" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_44.png" width="300" height="85" /&gt; &lt;/p&gt;  &lt;p&gt;It’s bugging me that LastName appears in the code before FirstName; that’s just plain wrong. So I move my cursor to the property name LastName and press Ctrl+Alt+Shift+Down:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Person class sorted" alt="Person class sorted" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_42.png" width="293" height="83" /&gt; &lt;/p&gt;  &lt;p&gt;Sorted! Of course I could have moved my cursor to the property name FirstName and pressed Ctrl+Alt+Shift+Up, which would have achieved the same result.&lt;/p&gt;  &lt;p&gt;What’s really nice is this key combination is context aware. So if you’re on a class name it’ll move the whole class up or down in the file, and if you’re on a statement block within a method it’ll move the whole statement block up or down too.&lt;/p&gt;  &lt;h2&gt;Navigate To Base Or Inheritor&lt;/h2&gt;  &lt;p&gt;This is another really useful set of shortcuts when navigating around unfamiliar code, and I use it a great deal when doing code reviews and trying to understand the flow of the code. Let’s say I’m looking at the following InvoiceProcessor class:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="InvoiceProcessor class" alt="InvoiceProcessor class" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_41.png" width="372" height="307" /&gt; &lt;/p&gt;  &lt;p&gt;And I’m trying to work out what happens in the SubmitInvoices method when SendConfirmation gets called on an IEmailSender. Well, if I move the cursor to the call to SendConfirmation and press Alt+End, it’ll try and find an inheritor of IEmailSender that implements SendConfirmation:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Implementing methods of SendConfirmation" alt="Implementing methods of SendConfirmation" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_40.png" width="254" height="82" /&gt; &lt;/p&gt;  &lt;p&gt;In this case I’ve got two classes that implement IEmailSender, so it gives me a list. Selecting one of these classes takes me straight to the method. However, if there was only a single class, it would have skipped the list and taken me straight to the only implementing method. In this case I chose the SpecialEmailSender:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="SpecialEmailSender class" alt="SpecialEmailSender class" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_39.png" width="418" height="127" /&gt; &lt;/p&gt;  &lt;p&gt;Now I’m here I see that SpecialEmailSender derives from EmailSender, not IEmailSender. My cursor is still over the SendConfirmation method name, so I press Alt+Home to take be to the base, and it takes me straight to EmailSender’s SendConfirmation method.&lt;/p&gt;  &lt;p&gt;There’s also a slightly more generic navigation shortcut that’s useful too, and that’s Alt+` (yes, that’s a back quote character). This pops up a navigation menu based on the current context:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="Navigate from Here to" alt="Navigate from Here to" src="http://phazed.com/files/media/image/WindowsLiveWriter/MoreReSharperShortcuts_145C9/image_38.png" width="228" height="144" /&gt;&lt;/p&gt;  &lt;p&gt;Well, that’s pretty much all my favourites covered for now. Any other ReSharper fans out there got any more?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bV3qKAxn5o2p2aqtSc9hjVPHeFc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bV3qKAxn5o2p2aqtSc9hjVPHeFc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bV3qKAxn5o2p2aqtSc9hjVPHeFc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bV3qKAxn5o2p2aqtSc9hjVPHeFc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Phazed?a=tyJjVETY"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=sxjRDJOr"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=sxjRDJOr" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=1RPet0nM"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=1RPet0nM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=8RbP7xsh"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Phazed?a=ZG9rwEMH"&gt;&lt;img src="http://feeds.feedburner.com/~f/Phazed?i=ZG9rwEMH" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Phazed/~4/bEwq_UannU4" height="1" width="1"/&gt;</description><georss:point>51.4141 0.7187</georss:point><feedburner:origLink>http://phazed.com/blog/more-resharper-shortcuts/</feedburner:origLink></item></channel></rss>
