<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nicholas Blumhardt</title>
	<atom:link href="http://nblumhardt.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nblumhardt.com</link>
	<description></description>
	<lastBuildDate>Mon, 05 Mar 2012 18:08:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Autofac update 2.6.1 published</title>
		<link>http://nblumhardt.com/2012/03/autofac-update-2-6-1-published/</link>
		<comments>http://nblumhardt.com/2012/03/autofac-update-2-6-1-published/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 15:55:20 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=326</guid>
		<description><![CDATA[The eagle-eyed may have already spotted Autofac 2.6.1 lurking in the NuGet feed. The last release, the venerable 2.5.2, served us very well (maturity is a feature!) and this release adds a little more polish, without any known breaking changes. The ASP.NET MVC integration package gets a bug fix for recursive views, UrlHelper and RequestContext&#8230;]]></description>
			<content:encoded><![CDATA[<p>The eagle-eyed may have already spotted <a href='http://nuget.org/packages/Autofac'>Autofac 2.6.1</a> lurking in the NuGet feed.</p>
<p>The last release, the venerable 2.5.2, served us very well (maturity is a feature!) and this release adds a little more polish, without any known breaking changes.</p>
<ul>
<li>The <a href='http://nuget.org/packages?q=autofac.mvc3'>ASP.NET MVC integration package</a> gets a bug fix for recursive views, <code class="codecolorer text default"><span class="text">UrlHelper</span></code> and <code class="codecolorer text default"><span class="text">RequestContext</span></code> registered by <code class="codecolorer text default"><span class="text">AutofacWebTypesModule</span></code>, and an explicit method for registering model binders.</li>
<li>The <a href='http://nuget.org/packages/Autofac.Wcf'>WCF integration package</a> gets much improved support for services with <code class="codecolorer text default"><span class="text">InstanceContextMode.Single</span></code>.</li>
<li>A new helper <code class="codecolorer text default"><span class="text">InstancePerOwned&lt;T&gt;()</span></code> makes it easier to control lifetime when using <code class="codecolorer text default"><span class="text">Owned&lt;T&gt;</span></code>.</li>
<li>Autofac can now be used with <a href='http://msdn.microsoft.com/en-us/library/gg597391.aspx'>.NET Portable Class Libraries</a> (download only on <a href='http://code.google.com/p/autofac/downloads/detail?name=Autofac-2.6.1.841-Portable.zip'>the project site</a>. (The Windows Phone 7 build now uses this configuration too.)</li>
<li><code class="codecolorer text default"><span class="text">Autofac.dll</span></code> is now clear of any issues found by <a href='http://msdn.microsoft.com/en-us/library/dd997356.aspx'>SecAnnotate.exe</a>.</li>
</ul>
<p>Extra thanks to <a href='http://alexmg.com/'>Alex</a> and <a href='http://www.paraesthesia.com/'>Travis</a> for the majority of these improvements.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2012/03/autofac-update-2-6-1-published/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convention-based part registration available in a new MEF preview!</title>
		<link>http://nblumhardt.com/2011/10/convention-based-part-registration-available-in-a-new-mef-preview/</link>
		<comments>http://nblumhardt.com/2011/10/convention-based-part-registration-available-in-a-new-mef-preview/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 20:24:20 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=320</guid>
		<description><![CDATA[There are many, many similarities between IoC-for-decoupling (as we know and love in Autofac) and IoC-for-extensibility as is implemented by MEF. One thing that stuck out in the beginning for the MEF project members with IoC backgrounds, was the verbosity of using [Import] and [Export] attributes to describe parts, instead of the much more terse&#8230;]]></description>
			<content:encoded><![CDATA[<p>There are many, many similarities between IoC-for-decoupling (as we know and love in <a href='http://autofac.org'>Autofac</a>) and IoC-for-extensibility as is implemented by <a href='http://mef.codeplex.com'>MEF</a>.</p>
<p>One thing that stuck out in the beginning for the MEF project members with IoC backgrounds, was the verbosity of using <code class="codecolorer text default"><span class="text">[Import]</span></code> and <code class="codecolorer text default"><span class="text">[Export]</span></code> attributes to describe parts, instead of the much more terse convention-driven approach used by IoC containers.</p>
<p>Over time, most of us grew to appreciate the role that the attributed programming model played in creating an unambiguous, decentralized configuration mechanism for plug-ins.</p>
<p>What the we also found was that applications using MEF for extensibility would also use it for internal composition, a-la IoC. In the much more controlled context of the host application, the lighter, more direct, convention-driven configuration model is compelling. DRY is one of the most important principles for building maintainable software, so techniques that eliminate repetition are very valuable.</p>
<p>It should be no surprise then, that the latest release of MEF (that I’ve only recently had any involvement in) comes with a nifty little model for defining parts by convention. The syntax should be familiar if you’re used to this kind of API:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:800px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">var builder <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> RegistrationBuilder<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
builder<span style="color: #008000;">.</span><span style="color: #0000FF;">ForTypesDerivedFrom</span><span style="color: #008000;">&lt;</span>Controller<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0000FF;">Export</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">.</span><span style="color: #0000FF;">SetCreationPolicy</span><span style="color: #008000;">&#40;</span>CreationPolicy<span style="color: #008000;">.</span><span style="color: #0000FF;">NonShared</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></div></div>
<p>When wired up to a MEF catalog, these simple conventions will read a part like:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:800px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> HomeController <span style="color: #008000;">:</span> &nbsp;Controller<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> HomeController<span style="color: #008000;">&#40;</span><span style="color: #008080; font-style: italic;">/* Dependencies here */</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> … <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> … <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>As:</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:800px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">&#91;</span>Export, PartCreationPolicy<span style="color: #008000;">&#40;</span>CreationPolicy<span style="color: #008000;">.</span><span style="color: #0000FF;">NonShared</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span><br />
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> HomeController <span style="color: #008000;">:</span> &nbsp;Controller<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#91;</span>ImportingConstructor<span style="color: #008000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> HomeController<span style="color: #008000;">&#40;</span><span style="color: #008080; font-style: italic;">/* Dependencies here */</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> … <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> … <span style="color: #008000;">&#125;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p><code class="codecolorer text default"><span class="text">RegistrationBuilder</span></code> has more than a few tricks up its sleeve, and we expect to write a lot more about it on the <a href='http://blogs.msdn.com/b/bclteam/'>BCL team blog</a> in the coming weeks. For now, you can <a href='http://blogs.msdn.com/b/bclteam/archive/2011/10/27/what-s-new-in-mef-version-2-preview-4.aspx'>read about the new release</a>, or even better, <a href='http://mef.codeplex.com/releases/view/75766'>download the preview source and binaries</a> from CodePlex.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/10/convention-based-part-registration-available-in-a-new-mef-preview/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Autofac 2.5 Released</title>
		<link>http://nblumhardt.com/2011/07/autofac-2-5-released/</link>
		<comments>http://nblumhardt.com/2011/07/autofac-2-5-released/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 22:53:23 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=312</guid>
		<description><![CDATA[Autofac 2.5 is now available on the project site and via NuGet. The new version includes a range of great contributions. After incubation as an external project, Windows Phone 7 now joins ranks of officially-supported targets (just install the Autofac package via NuGet and you&#8217;re up and running!) For some tips on getting started see&#8230;]]></description>
			<content:encoded><![CDATA[<p>Autofac 2.5 is now available on the <a href='http://autofac.org'>project site</a> and via <a href='http://nuget.org'>NuGet</a>. The new version includes a range of great contributions.</p>
<p>After incubation as an <a href='http://www.kowitz.net/autofac-on-wp7'>external project</a>, <a href='http://www.microsoft.com/windowsphone'>Windows Phone 7</a> now joins ranks of officially-supported targets (just install the <code class="codecolorer text default"><span class="text">Autofac</span></code> package via NuGet and you&#8217;re up and running!) For some tips on getting started see <a href='http://www.kowitz.net/configuring-autofac-for-wp7?utm_source=Silverlight-Zone.com&#038;utm_medium=SilverlightZone&#038;utm_campaign=kunal2383'>Brendan Kowitz&#8217;s notes</a>.</p>
<p>The new release is highly-compatible with Autofac 2.4 (best used with the VS2010 compiler when targeting .NET 3.5.)</p>
<p>Included changes are:</p>
<ul>
<li>Issue 329 &#8211; types are filtered by compatibilty before invoking key mapping functions when scanning assemblies</li>
<li><code class="codecolorer text default"><span class="text">RegisterAssemblyTypes(...).WithMetadataFrom&lt;T&gt;()</span></code> simplifies extraction of metadata from attribute properties</li>
<li><code class="codecolorer text default"><span class="text">Module.ThisAssembly</span></code> simplifies implementation of modules that scan their own assembly</li>
<li>Issue 333 &#8211; enable <code class="codecolorer text default"><span class="text">RegisterAssemblyTypes(...).PreserveExistingDefaults()</span></code></li>
<li>Windows Phone 7 and 7.1 support</li>
<li>Issue 312 &#8211; allow <code class="codecolorer text default"><span class="text">ContainerBuilder.Update()</span></code> on the <code class="codecolorer text default"><span class="text">ComponentRegistry</span></code> of any<br />
<code class="codecolorer text default"><span class="text">ILifetimeScope</span></code> without affecting the parent scope</li>
<li>Issue 327 &#8211; allow autowiring of enum properties</li>
<li>Issue 319 &#8211; support list and dictionary literals in XML configuration</li>
<li>Issue 330 &#8211; corrections to generic type constraint checking where the constraint type is an interface</li>
<li>Issue 331 &#8211; fix build warnings and runtime issues using Moq integration</li>
<li>Introduced <code class="codecolorer text default"><span class="text">ContainerBuildOptions</span></code> to control invocation of <code class="codecolorer text default"><span class="text">IStartable.Start()</span></code> under unit tests</li>
<li><code class="codecolorer text default"><span class="text">Container.Empty</span></code> is now a property rather than a field (protection from inadvertent updates</li>
<li>Removed broken/obsolete examples from source tree (better examples are available elsewhere online)</li>
<li>Host configuration features for <code class="codecolorer text default"><span class="text">AutofacHostFactory</span></code> in WCF integration</li>
<li><code class="codecolorer text default"><span class="text">ComponentRegistry.Register()</span></code> is now safe for use under multiple threads</li>
<li>Issue 227 &#8211; <strong>breaking change</strong> additional options (and enum rather than boolean parameter) for <code class="codecolorer text default"><span class="text">PropertiesAutowired()</span></code></li>
<li>Additional web abstractions are now registered by the MVC3 <code class="codecolorer text default"><span class="text">AutofacWebTypesModule</span></code></li>
<li>Issue 311 &#8211; fixed potential lifetime issues when injecting into MVC filter attributes</li>
<li>Tightened up behavior when correct constructor to use under reflection activator is ambiguous (now throws rather than choosing nondeterministically)</li>
<li>Issue 309 &#8211; fixed some issues in <code class="codecolorer text default"><span class="text">TypeExtensions.IsClosedTypeOf()</span></code></li>
<li>Improved exception messages</li>
</ul>
<p>Many thanks to the <a href='http://code.google.com/p/autofac/people/list'>Autofac project team</a> and collaborators across the web for making this release happen!</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/07/autofac-2-5-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Designing a Short Course on IoC: Day 5</title>
		<link>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-5/</link>
		<comments>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-5/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 23:09:01 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=309</guid>
		<description><![CDATA[The last of this curious series of journal entries today. As I mentioned previously, today is going to be about finalising the end-to-end flow of topics. I think the first session &#8211; Fundamentals &#8211; is finished. I&#8217;m really excited and even a little nervous about putting together a new container on the fly! As a&#8230;]]></description>
			<content:encoded><![CDATA[<p>The last of this curious series of journal entries today. As I mentioned <a href='http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-4/'>previously</a>, today is going to be about finalising the end-to-end flow of topics.</p>
<p>I think the first session &#8211; Fundamentals &#8211; is finished. I&#8217;m really excited and even a little nervous about putting together a new container on the fly! As a way of bedding down the terminology, mechanics and challenges, I think it is going to be great.</p>
<p>The layout for the remainder of the day still needs work, so I&#8217;d better get stuck into it! Those who&#8217;ve already signed up, I&#8217;ll see you soon &#8211; if you haven&#8217;t put your name down yet for either <a href='http://readify.net/our-events?event-id=62A62934-5215-43FB-9EC4-7F3BF6E058CD'>Brisbane</a>, <a href='http://readify.net/our-events?event-id=9DC9D217-CD23-4A11-90ED-1727E99C1018'>Sydney</a> or <a href='http://readify.net/our-events?event-id=37574063-A9C0-41C9-A4C7-2A6ED6D82DB0'>Melbourne</a>, this is probably the last reminder you&#8217;ll get from me.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-5/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Designing a Short Course on IoC: Day 4</title>
		<link>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-4/</link>
		<comments>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-4/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 23:33:52 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=304</guid>
		<description><![CDATA[A brief update today. Yesterday I think I covered everything I need to as far as demo app material goes, but tidying up, styling and (egads!) unit testing will have to wait for a rainy day. I spent a fair bit of time yesterday looking at how I can use Whitebox to give an x-ray&#8230;]]></description>
			<content:encoded><![CDATA[<p>A brief update today. <a href='http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-3/'>Yesterday</a> I think I covered everything I need to as far as demo app material goes, but tidying up, styling and (egads!) unit testing will have to wait for a rainy day.</p>
<p>I spent a fair bit of time yesterday looking at how I can use <a href='http://whitebox.googlecode.com'>Whitebox</a> to give an x-ray view of the composition process as the application is built. The information it provides is great &#8211; often revealing little issues that would otherwise go unnoticed &#8211; but the usability leaves me deeply unsatisfied. Still, it <em>is</em> a start, and by chipping away at it things are improving. Just having a simple view of component details is an improvement:</p>
<p><a href="http://nblumhardt.com/wp-content/uploads/2011/03/Capture.png"><img src="http://nblumhardt.com/wp-content/uploads/2011/03/Capture.png" alt="Whitebox component detail view" title="Component Detail" width="493" height="216" class="aligncenter size-full wp-image-306" /></a></p>
<p>Today I&#8217;m concentrating on the flow of the day. I still have some questions to answer around the introductory session &#8211; how theoretical do we want to get? Does it make sense to examine the problems of composition in OO languages, or can we take that as a given for people interested in learning more about IoC? My tendency in the past would have been to go into depth about this, but by starting with &#8220;you&#8217;re going to use IoC &#8211; here&#8217;s how to do it&#8221; I think the practical side of the Dev Day will be emphasised.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Designing a Short Course on IoC: Day 3</title>
		<link>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-3/</link>
		<comments>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-3/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 23:59:33 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=300</guid>
		<description><![CDATA[Is it just me, or am I slowing down? Yesterday was a busy day of programming, but there&#8217;s still a long way to go before this application is going to cut the mustard as an example for the course. In the end, I went with the idea of a timesheeting application. Simple material keeps out&#8230;]]></description>
			<content:encoded><![CDATA[<p>Is it just me, or am I slowing down? <a href='http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-2/'>Yesterday</a> was a busy day of programming, but there&#8217;s still a <em>long</em> way to go before this application is going to cut the mustard as an example for the course.</p>
<p>In the end, I went with the idea of a timesheeting application. Simple material keeps out of the way, and to be honest, there is so little logic or fancy presentation in this app that it could be changed from timesheets to another example in a relatively short space of time if need be.</p>
<p>Up and running, we have:</p>
<ul>
<li>A basic MVC3 app layout</li>
<li>IoC set up to create controllers</li>
<li>Data access with <a href='http://nhibernate.org'>NHibernate</a></li>
<li>Transaction management integrated with MVC</li>
<li>Logging with the venerable <a href='http://logging.apache.org/log4net/index.html'>log4net</a></li>
<li>A skeleton for &#8216;pick-me-up&#8217; domain events</li>
</ul>
<p>It is the last item that I&#8217;ll be working on in depth today. <em>&#8216;Pick-me-up&#8217; domain events</em> integrate domain models with external services in a way that plays better with IoC than the thread-static <code class="codecolorer text default"><span class="text">DomainEvents.Raise()</span></code> pattern commonly seen elsewhere.</p>
<p>Dispatching events to handlers is also a good example of the &#8216;generic handler&#8217; pattern that&#8217;s very widely used, and registering handlers will provide some further examples for convention-based/scanning registration.</p>
<p>To complete the day I&#8217;m aiming to polish up the last details of the basic MVC site (for example, error handling) and bed down an example of processing work in a background process to use in the &#8220;Resources and Units of Work&#8221; session. That leaves tomorrow and Friday for more detailed work on slides, some code samples for the &#8220;Containers&#8221; session, and some reworking of the example to fit into the flow of the course.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Designing a Short Course on IoC: Day 2</title>
		<link>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-2/</link>
		<comments>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-2/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 00:08:40 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=294</guid>
		<description><![CDATA[So, yesterday, a lot of thinking. Today it&#8217;s time to start fleshing out some of the things we&#8217;ll need. The course is going to be split into four sections, to match the natural division of the day by morning tea, lunch and afternoon tea: Fundamentals Effective IoC Resources and Units of Work Containers and Tooling&#8230;]]></description>
			<content:encoded><![CDATA[<p>So, <a href='http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-1/'>yesterday</a>, a lot of thinking. Today it&#8217;s time to start fleshing out some of the things we&#8217;ll need.</p>
<p>The course is going to be split into four sections, to match the natural division of the day by morning tea, lunch and afternoon tea:</p>
<ol>
<li>Fundamentals</li>
<li>Effective IoC</li>
<li>Resources and Units of Work</li>
<li>Containers and Tooling</li>
</ol>
<h3>Session 1: Fundamentals</h3>
<p>First up, we&#8217;ll set the theme of the day with some collaborative development. To introduce the vocabulary and concepts of IoC, we&#8217;ll write a simple IoC container in C# and integrate it into an ASP.NET MVC application. There are plenty of interesting design issues along the way that we&#8217;ll come back to in our discussion of containers and tooling.</p>
<h3>Session 2: Effective IoC</h3>
<p>The second session will introduce a &#8216;real&#8217; IoC container. The focus will be on techniques and features that allow IoC to support large, complex applications in the real world. We&#8217;ll touch on all of the typical components of MVC web applications as we migrate from the simple container we built ourselves, but we&#8217;ll pay special attention to the integration between IoC and domain models because of the challenges and opportunities they present.</p>
<h3>Session 3: Resources and Units of Work</h3>
<p><a href='http://nblumhardt.com/2011/01/an-autofac-lifetime-primer/'>Lifetime</a>, AKA &#8220;resource management&#8221; can be the toughest aspect of IoC to master. We&#8217;ll take an excursion outside of the comfort of the web tier, to develop a thorough understanding of the issues involved and their solutions.</p>
<p>Although it is far from being ready for prime time, <a href='http://whitebox.googlecode.com'>Whitebox</a> will be a great way to explore the runtime behaviour of lifetime scenarios, so sometime over the coming week I&#8217;ll look at filling remaining gaps there.</p>
<h3>Session 4: Containers and Tooling</h3>
<p>To round out the day, we&#8217;ll use the last session to take a leisurely tour of the sights, sounds and smells of the .NET IoC ecosystem. Choosing an IoC container can be tricky business, especially when the easiest metrics to grasp, for example throughput performance, are often misleading or irrelevant. In addition to looking at some of the popular offerings and their relative strengths, I think this is where a discussion of MEF and its role will fit in nicely.</p>
<p>Session 4 will also give us an opportunity to examine debugging and diagnostics issues.</p>
<h2>Today</h2>
<p>So, what do you think?</p>
<p>Today&#8217;s focus for me will be to take a first cut at building the example application. I&#8217;m going to leave the &#8216;simple container&#8217; design task for the event, so that we can truly do it on the fly! I want the day to be heavy on code and light on slides, so dressing up a slide deck with some guiding material will wait for later in the week.</p>
<p>Choosing what kind of application to build is tricky. I want attendees to be able to take something away, ideally a sample that isn&#8217;t too far from production readiness. In that respect, simpler will be better, though it can be hard to get enough breadth out of something like a &#8216;to-do&#8217; or &#8216;timesheeting&#8217; application. There&#8217;s some high-quality code on the web that might be reused for this purpose (e.g. <a href='http://funnelweblog.com'>FunnelWeb</a>) so building something that mimics an existing open source application has advantages.</p>
<p>I&#8217;ll update you tomorrow on where things land.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Designing a Short Course on IoC: Day 1</title>
		<link>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-1/</link>
		<comments>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-1/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 23:09:50 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=290</guid>
		<description><![CDATA[Today&#8217;s the start of a really exciting week for me! I&#8217;ve been working with Inversion of Control (IoC) Containers and related technologies since picking up Castle Windsor in 2006, actively developed Autofac for much of that time, and helped shape the first release of the Managed Extensibility Framework. In that period IoC has grown and&#8230;]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s the start of a really exciting week for me!</p>
<p>I&#8217;ve been working with Inversion of Control (IoC) Containers and related technologies since picking up <a href='http://castleproject.org'>Castle Windsor</a> in 2006, actively developed <a href='http://autofac.org'>Autofac</a> for much of that time, and helped shape the first release of the <a href='http://mef.codeplex.com'>Managed Extensibility Framework</a>. In that period IoC has grown and truly blossomed in the .NET world: from its &#8220;enterprise Java&#8221; <a href='http://avalon.apache.org'>roots</a> we&#8217;ve collectively created something that plays to the unique strengths of .NET and C#. Rather than being viewed as an esoteric fringe technology, as it was just a few years ago, IoC is firmly in the .NET mainstream and is increasingly being baked into the platform itself.</p>
<p>Along the way there have been many difficult questions posed, and I&#8217;ve had to ask and answer my share. It can be easy to go wrong with IoC &#8211; remember the &#8220;<a href='http://ayende.com/Blog/archive/2008/03/09/ALT.Net-Logo.aspx'>sharp tools</a>&#8221; analogy of the ALT.NET movement? &#8211; especially when finding the right approach to IoC in a new situation can mean finding several wrong ways first!</p>
<p>Last year at <a href='http://www.msteched.com/2010/Australia/DEV426'>TechEd Australia</a> I presented a breakout session on IoC in .NET. Though the feedback I received was positive, I was left feeling that an hour was too little time to get many of the concepts across in enough depth. So, this year courtesy of <a href='http://readify.net'>Readify</a> I&#8217;m going to be presenting a short course on <strong>IoC from the ground, up</strong>.</p>
<p>The course will be a full day, with dates in <em>May, 2011</em> set for:</p>
<ul>
<li><a href='http://readify.net/our-events?event-id=62A62934-5215-43FB-9EC4-7F3BF6E058CD'>Brisbane</a>,</li>
<li><a href='http://readify.net/our-events?event-id=9DC9D217-CD23-4A11-90ED-1727E99C1018'>Sydney</a> and</li>
<li><a href='http://readify.net/our-events?event-id=37574063-A9C0-41C9-A4C7-2A6ED6D82DB0'>Melbourne</a>.</li>
</ul>
<p>The unifying theme will be <a href='http://asp.net/mvc'>ASP.NET MVC</a>, but don&#8217;t be discouraged if this is not your primary platform. Much of what we cover will be independent of MVC and even of web programming in general. If you&#8217;re unfamiliar with ASP.NET MVC then it might help to brush up on that area if you want to keep up with some of the examples.</p>
<p>In terms of level of technical difficulty, I hope there will be something for everyone. You&#8217;ll get the most out of the day if you&#8217;re a confident .NET developer with beginner-to-intermediate experience with IoC, or if you&#8217;re an experienced user of IoC looking for broader and deeper perspectives on its use.</p>
<p>This week I&#8217;m preparing material for the course, and while I have a fair idea of the ground to cover, I&#8217;m interested in your ideas. I&#8217;ll be posting a progress update each day to keep you informed of where things are heading. I hope in the process I can convince you to come along, and bring your team!</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/03/designing-a-short-course-on-ioc-day-1/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Autofac 2.4.5 Release</title>
		<link>http://nblumhardt.com/2011/03/autofac-2-4-5-release/</link>
		<comments>http://nblumhardt.com/2011/03/autofac-2-4-5-release/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 00:17:09 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=284</guid>
		<description><![CDATA[More than a month has passed since the last patch release of Autofac 2.4, and enough has changed in trunk to warrant a new one. You can download Autofac 2.4.5 from the project site, or preferably, update your NuGet packages within Visual Studio. In this release you&#8217;ll find: Several bug fixes and improved exception messages&#8230;]]></description>
			<content:encoded><![CDATA[<p>More than a month has passed since the last patch release of Autofac 2.4, and enough has changed in trunk to warrant a new one. You can download Autofac 2.4.5 from <a href="http://autofac.org">the project site</a>, or preferably, update your <a href="http://nuget.org">NuGet</a> packages within Visual Studio.</p>
<p>In this release you&#8217;ll find:</p>
<ul>
<li>Several bug fixes and improved exception messages</li>
<li><a href="http://www.paraesthesia.com/">Travis</a> and <a href="http://alexmg.com">Alex</a> have been busy making the Multi-tenant contrib package work better with the new ASP.NET MVC3 integration</li>
<li>The awkward but very useful <code class="codecolorer text default"><span class="text">IContainerAwareComponent</span></code> introduced in 2.4 has been deprecated and morphed into a much friendlier and more useful <a href="http://code.google.com/p/autofac/wiki/Startable">Startable</a> implementation</li>
<li>Autofac now consistently throws <code class="codecolorer text default"><span class="text">DependencyResolutionException</span></code> (or a subclass) whenever fatal errors occur during composition</li>
</ul>
<p>Please feel free to drop in and share your experiences on the <a href="https://groups.google.com/forum/#!forum/autofac">discussion forum</a>. For help with using Autofac, including new features, the preferred medium is <a href="http://stackoverflow.com/questions/tagged/autofac">Stack Overflow</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/03/autofac-2-4-5-release/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Autofac 2.4 is here – come and “NuGet” it!</title>
		<link>http://nblumhardt.com/2011/01/autofac-2-4-is-here-%e2%80%93-come-and-%e2%80%9cnuget%e2%80%9d-it/</link>
		<comments>http://nblumhardt.com/2011/01/autofac-2-4-is-here-%e2%80%93-come-and-%e2%80%9cnuget%e2%80%9d-it/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 23:25:27 +0000</pubDate>
		<dc:creator>Nicholas Blumhardt</dc:creator>
				<category><![CDATA[Autofac]]></category>

		<guid isPermaLink="false">http://nblumhardt.com/?p=271</guid>
		<description><![CDATA[The latest release of the Autofac IoC container is now available on the project site and via NuGet. ASP.NET MVC Integration Changes The best thing in the new release, and possibly since sliced bread, is the new Autofac ASP.NET MVC integration. Gone are special interfaces on HttpApplication, gone are the Web.config file edits, static properties&#8230;]]></description>
			<content:encoded><![CDATA[<p>The latest release of the Autofac IoC container is now available on the <a href='http://autofac.org'>project site</a> and via <a href='http://nuget.org'>NuGet</a>.</p>
<h3>ASP.NET MVC Integration Changes</h3>
<p>The best thing in the new release, and possibly since sliced bread, is the new Autofac ASP.NET MVC integration. Gone are special interfaces on <code class="codecolorer text default"><span class="text">HttpApplication</span></code>, gone are the <code class="codecolorer text default"><span class="text">Web.config</span></code> file edits, static properties in the application class and multiple different extension points to configure. It couldn’t get any simpler than this.</p>
<p>Here’s how you create a new Autofac-enabled ASP.NET MVC3 project:</p>
<h4>1. Create a new MVC3 web application</h4>
<p><a href="http://nblumhardt.com/wp-content/uploads/2011/01/Step1.png"><img src="http://nblumhardt.com/wp-content/uploads/2011/01/Step1.png" alt="" title="Step1" width="858" height="456" class="aligncenter size-full wp-image-272" /></a></p>
<h4>2. Install the Autofac.Mvc3 Package</h4>
<p><a href="http://nblumhardt.com/wp-content/uploads/2011/01/Step2.png"><img src="http://nblumhardt.com/wp-content/uploads/2011/01/Step2.png" alt="" title="Step2" width="837" height="591" class="aligncenter size-full wp-image-273" /></a></p>
<h4>3. Set up the Container and DependencyResolver </h4>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:800px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> Application_Start<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; var builder <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ContainerBuilder<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; builder<span style="color: #008000;">.</span><span style="color: #0000FF;">RegisterControllers</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span>MvcApplication<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Assembly</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; var container <span style="color: #008000;">=</span> builder<span style="color: #008000;">.</span><span style="color: #0000FF;">Build</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; DependencyResolver<span style="color: #008000;">.</span><span style="color: #0000FF;">SetResolver</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> AutofacDependencyResolver<span style="color: #008000;">&#40;</span>container<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Other MVC setup...</span></div></div>
<h4>That’s it!</h4>
<p>That’s all you need to do to enable dependency injection into your controllers. There’s a lot more you can do with Autofac and ASP.NET MVC3 – I highly recommend checking out some of <a href='http://alexmg.com/category/Autofac.aspx'>Alex’s</a> recent posts on the subject.</p>
<p>The Autofac ASP.NET MVC integration now targets ASP.NET MVC <strong>version 3</strong> exclusively. Don’t worry if you’re unable to move to MVC3 right away, see the “Using Autofac 2.4 with ASP.NET MVC2” below.</p>
<h3>Complete NuGet Packages</h3>
<p>With Autofac 2.4, the recommended way to add Autofac and its sub-features to your applications is to use the <a href='http://nuget.org'>NuGet package manager</a>. You can see some of the available packages in the screen shot at step 2 above. Just search for “Autofac” and you’re away.</p>
<p>In the previous Autofac NuGet package, we included the MEF and WCF integrations by default. To keep clutter away, these are now in their own packages Autofac.Mef and Autofac.Wcf respectively.</p>
<h3>Improved Decorator Support</h3>
<p>The new and improved <a href=' http://nblumhardt.com/2011/01/decorator-support-in-autofac-2-4/'>decorator support</a> makes it much easier to wire up generic decorators with Autofac, and also provides a nice boost when using decorators in other scenarios.</p>
<h3>Removed Older Silverlight Versions from Supported Builds</h3>
<p>To keep the maintenance burden of the project as light as practical, it is occasionally necessary to discontinue ‘official’ support for older framework versions. In Autofac 2.4, the Silverlight 3 configuration is no longer available. Users of Silverlight 3 should continue to run the Autofac 2.3 builds (bug fixes will be provided for these whenever necessary.)</p>
<h3>Events and Interfaces to Support Tracing</h3>
<p>Like all IoC containers, Autofac’s internals can be somewhat opaque to follow at runtime. For the occasions that diagnostics are necessary, Autofac 2.4 supports more events that can be used to trace the operations of the container. As an example, <code class="codecolorer text default"><span class="text">ILifetimeScope</span></code> now supports <code class="codecolorer text default"><span class="text">LifetimeScopeBeginning</span></code>, <code class="codecolorer text default"><span class="text">ResolveOperationBeginning</span></code> and other related extension points.</p>
<p>It is intended that these will be used more by Autofac integration and tooling developers than in general application development.</p>
<h3>Other Release Notes</h3>
<p>The community has been busy as usual, and you’ll find quite a few other enhancements in this release.</p>
<ul>
<li><code class="codecolorer text default"><span class="text">.AsImplementedInterfaces()</span></code> is now supported on non-scanning registrations</li>
<li><code class="codecolorer text default"><span class="text">IDisposable</span></code> is no longer considered a service by <code class="codecolorer text default"><span class="text">.AsImplementedInterfaces()</span></code></li>
<li>Additional eager checks for generic type/service compatibility at registration time</li>
<li>An additional <code class="codecolorer text default"><span class="text">.WithParameter()</span></code> overload has been added, accepting predicate and value accessor like <code class="codecolorer text default"><span class="text">ResolvedParameter</span></code></li>
<li>Extension methods for common predicates on <code class="codecolorer text default"><span class="text">System.Type</span></code> are now public for use with scanning, e.g. <code class="codecolorer text default"><span class="text">Except(t =&gt; t.IsClosedTypeOf(x))</span></code></li>
<li>MVC <code class="codecolorer text default"><span class="text">ExtensibleActionInvoker</span></code> does not inject action method parameters by default</li>
<li><code class="codecolorer text default"><span class="text">ILifetimeScope</span></code> rather than <code class="codecolorer text default"><span class="text">IContainer</span></code> is now accepted by ServiceHostBase (WCF integration)</li>
<li><code class="codecolorer text default"><span class="text">AutofacInstanceContext</span></code> has been made public so that current scope can be retrieved when needed (WCF integration)</li>
<li>Bug fixes and enhancements in AutofacContrib.Multitenant and AutofacContrib.Attributed</li>
<li>Dependencies upgraded e.g. Castle Core and NHibernate</li>
<li>Fixed bug #288 &#8211; resolve all failing in customised lifetime scopes when one component supports multiple interfaces</li>
</ul>
<h3>Using Autofac 2.4 with ASP.NET MVC2</h3>
<p>If you’re  still using ASP.NET MVC2 in your application, the simplest course of action is to continue using the Autofac 2.3 release series and the appropriate integration bundled with that, until you’re able to upgrade wholesale to ASP.NET MVC3.</p>
<p>If you would like to use Autofac 2.4 with ASP.NET MVC, there is an updated Autofac.Mvc2 NuGet package now on the feed. If you’re already using the MVC2 NuGet package, update the package and you should be fine. If not, first remove all <code class="codecolorer text default"><span class="text">Autofac*.dll</span></code> references from your project and then install the Autofac.Mvc2 package using the “Add Library Reference” dialog.</p>
<p><strong>Edit:</strong> You need to add assembly binding redirects in order for the MVC2 package to work. The appropriate redirects are specified below (you may need to update them with the current Autofac version number) or you can use the commands <a href='http://blog.davidebbo.com/2011/01/nuget-versioning-part-3-unification-via.html'>bundled with NuGet</a>.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:800px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">&lt;</span>runtime<span style="color: #008000;">&gt;</span><br />
&nbsp; <span style="color: #008000;">&lt;</span>assemblyBinding xmlns<span style="color: #008000;">=</span><span style="color: #666666;">&quot;urn:schemas-microsoft-com:asm.v1&quot;</span><span style="color: #008000;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&lt;</span>dependentAssembly<span style="color: #008000;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #008000;">&lt;</span>assemblyIdentity name<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Autofac&quot;</span> publicKeyToken<span style="color: #008000;">=</span><span style="color: #666666;">&quot;17863af14b0044da&quot;</span> <span style="color: #008000;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #008000;">&lt;</span>bindingRedirect oldVersion<span style="color: #008000;">=</span><span style="color: #666666;">&quot;2.3.2.632&quot;</span> newVersion<span style="color: #008000;">=</span><span style="color: #666666;">&quot;2.4.3.700&quot;</span> <span style="color: #008000;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&lt;/</span>dependentAssembly<span style="color: #008000;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&lt;</span>dependentAssembly<span style="color: #008000;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #008000;">&lt;</span>assemblyIdentity name<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Autofac.Integration.Web&quot;</span> publicKeyToken<span style="color: #008000;">=</span><span style="color: #666666;">&quot;17863af14b0044da&quot;</span> <span style="color: #008000;">/&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #008000;">&lt;</span>bindingRedirect oldVersion<span style="color: #008000;">=</span><span style="color: #666666;">&quot;2.3.2.632&quot;</span> newVersion<span style="color: #008000;">=</span><span style="color: #666666;">&quot;2.4.3.700&quot;</span> <span style="color: #008000;">/&gt;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&lt;/</span>dependentAssembly<span style="color: #008000;">&gt;</span><br />
&nbsp; <span style="color: #008000;">&lt;/</span>assemblyBinding<span style="color: #008000;">&gt;</span><br />
<span style="color: #008000;">&lt;/</span>runtime<span style="color: #008000;">&gt;</span></div></div>
<h3>Summing Up</h3>
<p>I hope that with this release, Autofac is now easier to get and set up than ever before. It has once again been a team effort – thanks especially to the <a href=' http://code.google.com/p/autofac/people/list'>contributors</a> and everyone who has submitted issue reports or patches.</p>
]]></content:encoded>
			<wfw:commentRss>http://nblumhardt.com/2011/01/autofac-2-4-is-here-%e2%80%93-come-and-%e2%80%9cnuget%e2%80%9d-it/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

