<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: One more interesting and fresh .NET IoC container: autofac</title>
	<atom:link href="http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/feed/" rel="self" type="application/rss+xml" />
	<link>http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/</link>
	<description>Moving towards the efficient development of smart software solutions in C# .NET</description>
	<pubDate>Mon, 08 Sep 2008 07:13:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Arturas</title>
		<link>http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-476</link>
		<dc:creator>Arturas</dc:creator>
		<pubDate>Mon, 12 May 2008 12:21:54 +0000</pubDate>
		<guid isPermaLink="false">http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-476</guid>
		<description>Just a couple of days ago we released our lightweight .NET inversion of control (IoC, dependency injection) container called Winter4net. It's fast, compact and scalable. Visit our site for more details - http://www.winter4.net or you can contact us through the feedback form. Oh i forgot to mention that we offer free community efition binary license!</description>
		<content:encoded><![CDATA[<p>Just a couple of days ago we released our lightweight .NET inversion of control (IoC, dependency injection) container called Winter4net. It&#8217;s fast, compact and scalable. Visit our site for more details - <a href="http://www.winter4.net" rel="nofollow">http://www.winter4.net</a> or you can contact us through the feedback form. Oh i forgot to mention that we offer free community efition binary license!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rinat Abdullin</title>
		<link>http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-37</link>
		<dc:creator>Rinat Abdullin</dc:creator>
		<pubDate>Thu, 10 Jan 2008 10:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-37</guid>
		<description>Nicholas, thank you very much for this description!

I should've figured out myself, that the lambda will do the trick by pulling the component out of the current context. 

This elegant flexibility is awesome! And that specific implementation is a great solution to the MicroKernel's problem (their dependency resolution takes place in the context where the component has been registered).

I'll definitely spend a bit more time with the autofac IoC.</description>
		<content:encoded><![CDATA[<p>Nicholas, thank you very much for this description!</p>
<p>I should&#8217;ve figured out myself, that the lambda will do the trick by pulling the component out of the current context. </p>
<p>This elegant flexibility is awesome! And that specific implementation is a great solution to the MicroKernel&#8217;s problem (their dependency resolution takes place in the context where the component has been registered).</p>
<p>I&#8217;ll definitely spend a bit more time with the autofac IoC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Blumhardt</title>
		<link>http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-32</link>
		<dc:creator>Nicholas Blumhardt</dc:creator>
		<pubDate>Thu, 10 Jan 2008 04:06:47 +0000</pubDate>
		<guid isPermaLink="false">http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-32</guid>
		<description>Oops, your commenting system accepts HTML... That code should read:

ContainerBuilder cb = new ContainerBuilder();
cb.Register(c =&#62; new A(c.Resolve&#60;B&#62;()))
&#160;&#160;.WithScope(InstanceScope.Factory);

Container parent = cb.Build();

Container child = cb.CreateInnerContainer();
ContainerBuilder childBuilder = new ContainerBuilder();
childBuilder.Register(c =&#62; new B());
childBuilder.Build(child);

A a = child.Resolve&#60;A&#62;();</description>
		<content:encoded><![CDATA[<p>Oops, your commenting system accepts HTML&#8230; That code should read:</p>
<p>ContainerBuilder cb = new ContainerBuilder();<br />
cb.Register(c =&gt; new A(c.Resolve&lt;B&gt;()))<br />
&nbsp;&nbsp;.WithScope(InstanceScope.Factory);</p>
<p>Container parent = cb.Build();</p>
<p>Container child = cb.CreateInnerContainer();<br />
ContainerBuilder childBuilder = new ContainerBuilder();<br />
childBuilder.Register(c =&gt; new B());<br />
childBuilder.Build(child);</p>
<p>A a = child.Resolve&lt;A&gt;();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Blumhardt</title>
		<link>http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-31</link>
		<dc:creator>Nicholas Blumhardt</dc:creator>
		<pubDate>Thu, 10 Jan 2008 04:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://rabdullin.com/one-more-interesting-and-fresh-net-ioc-container-autofac/#comment-31</guid>
		<description>Hi Rinat,

Thanks for your comment over on my blog. I'm glad autofac makes sense to you :)

The scenario you've described (at a first glance) looks very straightforward in Autofac to me:

ContainerBuilder cb = new ContainerBuilder();
cb.Register(c =&#62; new A(c.Resolve&#60;B&#62;()))
  .WithScope(InstanceScope.Factory);

Container parent = cb.Build();

Container child = cb.CreateInnerContainer();
ContainerBuilder childBuilder = new ContainerBuilder();
childBuilder.Register(c =&#62; new B());
childBuilder.Build(child);

A a = child.Resolve&#60;A&#62;(); // will now work as you expect.

What you've touched on is exactly the reason that the expressions take the container (through IContext) as their first argument, rather than use a closure to resolve dependencies from the container. When the resolve is done in the child scope, the _child_ container will be passed as the argument to the expression creating A.

Happy to go into this further if you're interested.

Nick</description>
		<content:encoded><![CDATA[<p>Hi Rinat,</p>
<p>Thanks for your comment over on my blog. I&#8217;m glad autofac makes sense to you :)</p>
<p>The scenario you&#8217;ve described (at a first glance) looks very straightforward in Autofac to me:</p>
<p>ContainerBuilder cb = new ContainerBuilder();<br />
cb.Register(c =&gt; new A(c.Resolve&lt;B&gt;()))<br />
  .WithScope(InstanceScope.Factory);</p>
<p>Container parent = cb.Build();</p>
<p>Container child = cb.CreateInnerContainer();<br />
ContainerBuilder childBuilder = new ContainerBuilder();<br />
childBuilder.Register(c =&gt; new B());<br />
childBuilder.Build(child);</p>
<p>A a = child.Resolve&lt;A&gt;(); // will now work as you expect.</p>
<p>What you&#8217;ve touched on is exactly the reason that the expressions take the container (through IContext) as their first argument, rather than use a closure to resolve dependencies from the container. When the resolve is done in the child scope, the _child_ container will be passed as the argument to the expression creating A.</p>
<p>Happy to go into this further if you&#8217;re interested.</p>
<p>Nick</p>
]]></content:encoded>
	</item>
</channel>
</rss>
