<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tim Barcz : Rant, Windsor</title><link>http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/Windsor/default.aspx</link><description>Tags: Rant, Windsor</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Your IoC Container Choice is Not a Feature of Your Application</title><link>http://devlicio.us/blogs/tim_barcz/archive/2009/03/29/your-ioc-container-choice-is-not-a-feature-of-your-application.aspx</link><pubDate>Mon, 30 Mar 2009 02:51:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:45231</guid><dc:creator>Tim Barcz</dc:creator><slash:comments>30</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://devlicio.us/blogs/tim_barcz/rsscomments.aspx?PostID=45231</wfw:commentRss><comments>http://devlicio.us/blogs/tim_barcz/archive/2009/03/29/your-ioc-container-choice-is-not-a-feature-of-your-application.aspx#comments</comments><description>&lt;p&gt;I don&amp;#39;t want to be a wet blanket, but someone&amp;#39;s got to put a stop to the IoC love fest going on out there.&amp;nbsp; An Inversion of Control (IoC) container , for those of you were aren&amp;#39;t yet familiar, allows you to retrieve instances of objects at runtime.&amp;nbsp; A relatively common solution to a common problem. In the .NET world there is no lack of choices of IoC containers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.castleproject.org/container/index.html"&gt;Castle&amp;#39;s Winsdor/MicroKernel&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.springframework.net/"&gt;Spring.NET&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/p/autofac/"&gt;AutoFac&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://ninject.org/"&gt;Ninject&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc468366.aspx"&gt;Unity&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://funq.codeplex.com/"&gt;Funq&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(I won&amp;#39;t go fully into IoC, but If you&amp;#39;d like more resource you can read &lt;a href="http://martinfowler.com/articles/injection.html"&gt;Martin Fowler&amp;#39;s article on the subject&lt;/a&gt; or post specific questions in the comments or contact me through.&amp;nbsp; Read on, there is value here in this post for you.)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Let me state clearly now, IoC containers are a means to an end and NOT a feature of your application.&lt;/b&gt; The goal is to have loosely coupled applications, IoC containers help get you there, but you can absolutely have a loosely coupled application without an IoC container (see the &lt;a href="http://www.dofactory.com/Patterns/Patterns.aspx"&gt;Gang of Four creational patterns&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Occasionally I&amp;#39;ll hear some comment about IoC and how great a certain container is or how an application would be so much better if another, sexier, container was used.&amp;nbsp; Here are some recent &lt;a href="http://www.twitter.com"&gt;tweets&lt;/a&gt; that illustrate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Man i love #StructureMap, always finding new things i can do, and have fun doing them &lt;/li&gt;
&lt;li&gt;really need to look at structuremap, but we&amp;#39;&amp;#39;ve invested a lot into castle with our own facilities/resolvers/etc &lt;/li&gt;
&lt;li&gt;Ninject is da bomb! &lt;/li&gt;
&lt;li&gt;Switched from Windsor MicroKernel to Ninject in 10KLOC project in &amp;lt; 1 hour by creating a little proxy. Now to complete the conversion. &lt;/li&gt;
&lt;li&gt;It is a talk on Castle Windsor so i guess Ninject will not do. &lt;/li&gt;
&lt;li&gt;Can&amp;#39;t imagine why somebody would use Ninject beside the fact that it&amp;#39;s PURE AND UTTER AWESOME. Yeah! Ninject FTW. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some of the statements above are probably innocuous, but some rub me slightly the wrong way.&amp;nbsp; Specifically the two comments above about switching from one container to another. There are probably times when the choice of one container over another makes sense, but I would bet that these scenarios are the exception and not the rule.&lt;/p&gt;
&lt;p&gt;Choosing one container over another won&amp;#39;t make your application a success, the architecture, or lack there of, will have far more of a say on your application than will your container choice. As yoda might say, &amp;quot;The container you choose does not a good app make&amp;quot;. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=45231" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Rant/default.aspx">Rant</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Opinion/default.aspx">Opinion</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Windsor/default.aspx">Windsor</category><category domain="http://devlicio.us/blogs/tim_barcz/archive/tags/Tools/default.aspx">Tools</category></item></channel></rss>