<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Advanced StructureMap: connecting implementations to open generic types</title>
	<atom:link href="http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Thu, 23 May 2013 23:40:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: corey coogan</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2129</link>
		<dc:creator>corey coogan</dc:creator>
		<pubDate>Fri, 22 Jan 2010 15:33:16 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2129</guid>
		<description>Great article Jimmy.  One thing that I&#039;m missing here is how you go about raising the events or calling the commands. 

I assume you are using some sort of EventAggregator?  I love what you are showing here for registering the listeners and would like some closure on the big picture.</description>
		<content:encoded><![CDATA[<p>Great article Jimmy.  One thing that I&#8217;m missing here is how you go about raising the events or calling the commands. </p>
<p>I assume you are using some sort of EventAggregator?  I love what you are showing here for registering the listeners and would like some closure on the big picture.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Nilsson</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2128</link>
		<dc:creator>Martin Nilsson</dc:creator>
		<pubDate>Fri, 08 Jan 2010 11:52:12 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2128</guid>
		<description>In Windsor:

//Registration
Kernel.Register(AllTypes.Of(typeof(IHandler&lt;&gt;)).FromAssembly(typeof(OrderCanceledEvent).Assembly).WithService.FirstInterface());

//Implementation
public class OrderCanceledEvent : IHandler&lt;OrderCanceledMessage&gt;
{}

//Usage
public class SomeClass(IHandler&lt;OrderCanceledMessage&gt; handler)
{}</description>
		<content:encoded><![CDATA[<p>In Windsor:</p>
<p>//Registration<br />
Kernel.Register(AllTypes.Of(typeof(IHandler<>)).FromAssembly(typeof(OrderCanceledEvent).Assembly).WithService.FirstInterface());</p>
<p>//Implementation<br />
public class OrderCanceledEvent : IHandler<ordercanceledmessage><br />
{}</p>
<p>//Usage<br />
public class SomeClass(IHandler</ordercanceledmessage><ordercanceledmessage> handler)<br />
{}</ordercanceledmessage></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mob</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2127</link>
		<dc:creator>mob</dc:creator>
		<pubDate>Fri, 25 Dec 2009 19:19:18 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2127</guid>
		<description>This is pretty sweet. I just knocked down all my individual repository registrations to a few lines. Thanks for pointing this out.</description>
		<content:encoded><![CDATA[<p>This is pretty sweet. I just knocked down all my individual repository registrations to a few lines. Thanks for pointing this out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Greer</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2126</link>
		<dc:creator>Derek Greer</dc:creator>
		<pubDate>Mon, 21 Dec 2009 13:51:25 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2126</guid>
		<description>Very cool stuff.  I added this ability to an extension I wrote for Unity (see http://bit.ly/6FcCwl) after you first tweeted about it back in August, but its features like this that have made me consider StructureMap for future projects.</description>
		<content:encoded><![CDATA[<p>Very cool stuff.  I added this ability to an extension I wrote for Unity (see <a href="http://bit.ly/6FcCwl" rel="nofollow">http://bit.ly/6FcCwl</a>) after you first tweeted about it back in August, but its features like this that have made me consider StructureMap for future projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artem Govorov</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2125</link>
		<dc:creator>Artem Govorov</dc:creator>
		<pubDate>Mon, 21 Dec 2009 00:34:56 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2125</guid>
		<description>&gt;I’ve taken a look at the other containers, and frankly, I haven’t
&gt;found any that match this level of simplicity in configuration.  But
&gt;I’m not an expert on the other containers, so I’d love to be
&gt;proven wrong!
I think you&#039;ve described special case usage of more general auto registration feature. I have implemented general auto registration solution with nice fluent syntax for Unity (see here http://autoregistration.codeplex.com/), Marcin Budny had created predicate for open generics to simplify registering them (http://marcinbudny.blogspot.com/2009/11/unity-auto-registration.html). You can have a look and compare readability and simplicity.</description>
		<content:encoded><![CDATA[<p>>I’ve taken a look at the other containers, and frankly, I haven’t<br />
>found any that match this level of simplicity in configuration.  But<br />
>I’m not an expert on the other containers, so I’d love to be<br />
>proven wrong!<br />
I think you&#8217;ve described special case usage of more general auto registration feature. I have implemented general auto registration solution with nice fluent syntax for Unity (see here <a href="http://autoregistration.codeplex.com/" rel="nofollow">http://autoregistration.codeplex.com/</a>), Marcin Budny had created predicate for open generics to simplify registering them (<a href="http://marcinbudny.blogspot.com/2009/11/unity-auto-registration.html" rel="nofollow">http://marcinbudny.blogspot.com/2009/11/unity-auto-registration.html</a>). You can have a look and compare readability and simplicity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2124</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Sun, 20 Dec 2009 19:52:47 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2124</guid>
		<description>@Paul

This is in the trunk version, but will be in the upcoming 2.5.4 release.

@Eric

What does WithService.Base() do exactly?</description>
		<content:encoded><![CDATA[<p>@Paul</p>
<p>This is in the trunk version, but will be in the upcoming 2.5.4 release.</p>
<p>@Eric</p>
<p>What does WithService.Base() do exactly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Hauser</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2123</link>
		<dc:creator>Eric Hauser</dc:creator>
		<pubDate>Sun, 20 Dec 2009 14:00:08 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2123</guid>
		<description>@Jimmy/Joshua

Correct, James article does not show how to register this scenario.  Here&#039;s an example using the registration API:
            
kernel.Register(AllTypes.Pick().FromAssembly(Assembly.GetExecutingAssembly()).BasedOn(typeof(ICommand&lt;&gt;)).WithService.Base());

</description>
		<content:encoded><![CDATA[<p>@Jimmy/Joshua</p>
<p>Correct, James article does not show how to register this scenario.  Here&#8217;s an example using the registration API:</p>
<p>kernel.Register(AllTypes.Pick().FromAssembly(Assembly.GetExecutingAssembly()).BasedOn(typeof(ICommand<>)).WithService.Base());</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Linton</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2122</link>
		<dc:creator>Paul Linton</dc:creator>
		<pubDate>Sat, 19 Dec 2009 04:09:22 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2122</guid>
		<description>What version of SM has ConnectImplementationsToTypesClosing?  Has it been released?
thanks</description>
		<content:encoded><![CDATA[<p>What version of SM has ConnectImplementationsToTypesClosing?  Has it been released?<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Flanagan</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2121</link>
		<dc:creator>Joshua Flanagan</dc:creator>
		<pubDate>Fri, 18 Dec 2009 14:00:49 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2121</guid>
		<description>@Eric - that Windsor example is a little different from what Jimmy is talking about. In James example, he is explicitly telling the Windsor which concrete (Repository&lt;T&gt;) type to use for the interface (IRepository&lt;T&gt;).
In the StructureMap example, Jimmy never explicitly tells the container which concrete type to use. This allows concrete types with different implementations such as OrderRepository and CustomerRepository, instead of just Repository&lt;Order&gt; and Repository&lt;Customer&gt; (which really have the same implementation).</description>
		<content:encoded><![CDATA[<p>@Eric &#8211; that Windsor example is a little different from what Jimmy is talking about. In James example, he is explicitly telling the Windsor which concrete (Repository<t>) type to use for the interface (IRepository</t><t>).<br />
In the StructureMap example, Jimmy never explicitly tells the container which concrete type to use. This allows concrete types with different implementations such as OrderRepository and CustomerRepository, instead of just Repository<order> and Repository<customer> (which really have the same implementation).</customer></order></t></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/12/18/advanced-structuremap-connecting-implementations-to-open-generic-types/#comment-2120</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Fri, 18 Dec 2009 13:40:52 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/12/17/advanced-structuremap-connecting-implementations-to-open-generic-types.aspx#comment-2120</guid>
		<description>@Eric Hauser

That&#039;s not quite the same solution.  In that post, you&#039;re connecting an open generic interface to an open generic implementation.  In my example, you&#039;re connecting types that close the generic interface to its implementation.

For example, we have around 200 implementors of a Command&lt;T&gt;.  Registering all 200 unique implementors requires 1 line of StructureMap registration code.</description>
		<content:encoded><![CDATA[<p>@Eric Hauser</p>
<p>That&#8217;s not quite the same solution.  In that post, you&#8217;re connecting an open generic interface to an open generic implementation.  In my example, you&#8217;re connecting types that close the generic interface to its implementation.</p>
<p>For example, we have around 200 implementors of a Command<t>.  Registering all 200 unique implementors requires 1 line of StructureMap registration code.</t></p>
]]></content:encoded>
	</item>
</channel>
</rss>
