{"id":4985,"date":"2014-03-30T17:28:28","date_gmt":"2014-03-30T17:28:28","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/which-net-dependency-injection-frameworks-are-worth-looking-into-closed-collection-of-common-programming-errors\/"},"modified":"2014-03-30T17:28:28","modified_gmt":"2014-03-30T17:28:28","slug":"which-net-dependency-injection-frameworks-are-worth-looking-into-closed-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/which-net-dependency-injection-frameworks-are-worth-looking-into-closed-collection-of-common-programming-errors\/","title":{"rendered":"Which .NET Dependency Injection frameworks are worth looking into? [closed]-Collection of common programming errors"},"content":{"rendered":"<p>I suppose I might be being a bit picky here but it&#8217;s important to note DI (Dependency Injection) is a programming pattern and is facilitated by (but does not require) an IoC (Inversion of Control) Framework. IoC Frameworks just make DI much easier, but it&#8217;s not only DI that they do, they provide a host of other benefits over and above DI.<\/p>\n<p>That being said, I&#8217;m sure that&#8217;s what you were asking: about IoC Frameworks: I used to use Spring.Net and CastleWindsor a lot, but the real pain in the beehiind was all that pesky XML config you had to write! They&#8217;re pretty much all moving this way now, but I started using StructureMap for the last year or so, and since it has moved to a fluent config using strongly typed generics and a registry, my pain barrier in using IoC has dropped below zero! I get an absolute kick out of knowing now that my IoC config is checked at compile-time (for the most part) and I have had nothing but joy with StructureMap and its speed. I won&#8217;t say that the others were slow (runtime), but they were more difficult for me to setup and frustration often won the day.<\/p>\n<p>I believe they&#8217;re all moving towards a more strongly typed config now &#8211; or at least providing the option, but some people love putting all the config in XML &#8211; personally I can&#8217;t bare it, so I have stuck to StructureMap now.<\/p>\n<p>I can&#8217;t comment much on Ninject except that I listened to Nate on one of the Herding Code podcasts and he&#8217;s one <em>switched-on<\/em> guy, and the screencasts I&#8217;ve watched have really tempted me to try it out &#8211; maybe on the next project &#8211; who knows.<\/p>\n<p><strong>Update:<\/strong> In a follow up to my comments here, I&#8217;ve been using Ninject (as promised) on my latest project and it has been an <em>absolute pleasure<\/em> to use. Words fail me a bit here, but (as we say in the UK) this framework is <em>the Dogs&#8217;<\/em>. I highly recommend it for any green fields projects where you want to be up and running quickly. I got all I needed from a fantastic set of Ninject screencasts by Justin Etheredge. I also can&#8217;t see that retro-fitting Ninject into existing (above average) code being a problem at all &#8211; but then the same could be said of StructureMap in my experience. It&#8217;ll be a tough choice going forward between those two, but I&#8217;d rather have competition than stagnation and there&#8217;s a decent amount of healthy competition out there.<\/p>\n<p>Other IoC screencasts can also be found here on Dimecasts.<\/p>\n<p>Hope that helps,<\/p>\n<p>Rob G<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I suppose I might be being a bit picky here but it&#8217;s important to note DI (Dependency Injection) is a programming pattern and is facilitated by (but does not require) an IoC (Inversion of Control) Framework. IoC Frameworks just make DI much easier, but it&#8217;s not only DI that they do, they provide a host [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4985","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4985"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4985\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}