<?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: How not to do Dependency Injection, in NerdDinner</title>
	<atom:link href="http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Wed, 22 May 2013 13:39: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: Inyectando dependencias en Windows 8 Metro &#124; Kinetica Solutions Blogs</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-4823</link>
		<dc:creator>Inyectando dependencias en Windows 8 Metro &#124; Kinetica Solutions Blogs</dc:creator>
		<pubDate>Wed, 15 Aug 2012 22:21:04 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-4823</guid>
		<description>[...] una red de dependencias un poco más compleja entre nuestros objetos. Lo primero que hicimos fue resolver estas dependencias en el constructor. Pero después nos preguntamos, cómo sería esto si tuviésemos un contenedor que resuelva las [...]</description>
		<content:encoded><![CDATA[<p>[...] una red de dependencias un poco más compleja entre nuestros objetos. Lo primero que hicimos fue resolver estas dependencias en el constructor. Pero después nos preguntamos, cómo sería esto si tuviésemos un contenedor que resuelva las [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: IoC vs ServiceLocator &#124; Contexto</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-3968</link>
		<dc:creator>IoC vs ServiceLocator &#124; Contexto</dc:creator>
		<pubDate>Sun, 02 Oct 2011 10:13:34 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-3968</guid>
		<description>[...] podemos tener (aunque no sea muy recomendable) DI para pobres, en la que &#8220;más o menos&#8221; inyectamos las dependencias &#8220;a mano&#8221; a partir de [...]</description>
		<content:encoded><![CDATA[<p>[...] podemos tener (aunque no sea muy recomendable) DI para pobres, en la que &#8220;más o menos&#8221; inyectamos las dependencias &#8220;a mano&#8221; a partir de [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1712</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Sat, 25 Jul 2009 18:21:48 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1712</guid>
		<description>@Pat

Yes, my IDE nearly exploded with the weight of new code added to employ DI.  I&#039;m not sure how my machine was able to handle the extra order of magnitude of code created to support dependency injection.

Poor man&#039;s DI requires _more_ coding, not less, as the example above showed.  Poor man&#039;s DI is by definition more coupled, as I am coupled to specific implementations, as opposed to abstract interfaces.  I highly recommend you check out Uncle Bob&#039;s Agile Software Development book, he explains far better than I how following the SOLID design principles improves your code.</description>
		<content:encoded><![CDATA[<p>@Pat</p>
<p>Yes, my IDE nearly exploded with the weight of new code added to employ DI.  I&#8217;m not sure how my machine was able to handle the extra order of magnitude of code created to support dependency injection.</p>
<p>Poor man&#8217;s DI requires _more_ coding, not less, as the example above showed.  Poor man&#8217;s DI is by definition more coupled, as I am coupled to specific implementations, as opposed to abstract interfaces.  I highly recommend you check out Uncle Bob&#8217;s Agile Software Development book, he explains far better than I how following the SOLID design principles improves your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pat Maddox</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1711</link>
		<dc:creator>Pat Maddox</dc:creator>
		<pubDate>Sat, 25 Jul 2009 16:18:23 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1711</guid>
		<description>I think it&#039;s funny how you managed to up the code size by 10x without making it better, and still call it better. The code is tightly coupled? Uh, no. Just pass something in via the 1-arg constructor</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s funny how you managed to up the code size by 10x without making it better, and still call it better. The code is tightly coupled? Uh, no. Just pass something in via the 1-arg constructor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1710</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Tue, 14 Jul 2009 13:04:24 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1710</guid>
		<description>@Rob

Don&#039;t worry - I was told about 80 times after I posted this that you guys explained this in the material.

This _is_ a valid pattern, as are all, and I think I need to explain where each is valid.</description>
		<content:encoded><![CDATA[<p>@Rob</p>
<p>Don&#8217;t worry &#8211; I was told about 80 times after I posted this that you guys explained this in the material.</p>
<p>This _is_ a valid pattern, as are all, and I think I need to explain where each is valid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Conery</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1709</link>
		<dc:creator>Rob Conery</dc:creator>
		<pubDate>Tue, 14 Jul 2009 07:12:48 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1709</guid>
		<description>Hi guys - I&#039;m the one who wrote this so I&#039;ll speak to why it was done this way. First I&#039;m going to defend what we did: it&#039;s not wrong if it works :) and it works.

I did raise the point to &quot;the Scotts&quot; about the coupling issue - that DI will allow you know only the interface and not the implementation but the general feeling was that we&#039;re not building the Stock Exchange and to try to introduce the concept of IoC while at the same time talking about DI seemed just a tad silly.

Sure using StructureMap is &quot;better&quot; - you know I agree with that. But the thing you&#039;re missing here is understanding the pattern before improving it and if you were to read the tutorial I wrote exactly that: &quot;we have an issue with this constructor ...&quot; but my guess is you didn&#039;t. That&#039;s OK, I&#039;m used to it :)</description>
		<content:encoded><![CDATA[<p>Hi guys &#8211; I&#8217;m the one who wrote this so I&#8217;ll speak to why it was done this way. First I&#8217;m going to defend what we did: it&#8217;s not wrong if it works <img src='http://lostechies.com/jimmybogard/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and it works.</p>
<p>I did raise the point to &#8220;the Scotts&#8221; about the coupling issue &#8211; that DI will allow you know only the interface and not the implementation but the general feeling was that we&#8217;re not building the Stock Exchange and to try to introduce the concept of IoC while at the same time talking about DI seemed just a tad silly.</p>
<p>Sure using StructureMap is &#8220;better&#8221; &#8211; you know I agree with that. But the thing you&#8217;re missing here is understanding the pattern before improving it and if you were to read the tutorial I wrote exactly that: &#8220;we have an issue with this constructor &#8230;&#8221; but my guess is you didn&#8217;t. That&#8217;s OK, I&#8217;m used to it <img src='http://lostechies.com/jimmybogard/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anne Epstein</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1708</link>
		<dc:creator>Anne Epstein</dc:creator>
		<pubDate>Wed, 08 Jul 2009 05:04:53 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1708</guid>
		<description>Brendan addressed this, but I really think it&#039;s worth emphasizing that though it would certainly be an antipattern to write *new* code like this,  &quot;poor man&#039;s DI&quot; can be really useful in situations with a significant established codebase that was written using parameterless constructors.. In those codebases, it&#039;s the no-arg constructor that&#039;s the original, primary constructor. Writing the add-on DI-friendly constructor in addition to the existing no-args constructor is a way work in testability without having to touch the rest of the codebase, allows new code to use the DI-friendly constructor, and provides a target for future refactoring of  the old code to use the new constructor when possible.   (hopefully very soon!)  </description>
		<content:encoded><![CDATA[<p>Brendan addressed this, but I really think it&#8217;s worth emphasizing that though it would certainly be an antipattern to write *new* code like this,  &#8220;poor man&#8217;s DI&#8221; can be really useful in situations with a significant established codebase that was written using parameterless constructors.. In those codebases, it&#8217;s the no-arg constructor that&#8217;s the original, primary constructor. Writing the add-on DI-friendly constructor in addition to the existing no-args constructor is a way work in testability without having to touch the rest of the codebase, allows new code to use the DI-friendly constructor, and provides a target for future refactoring of  the old code to use the new constructor when possible.   (hopefully very soon!)  </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1707</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Tue, 07 Jul 2009 12:20:20 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1707</guid>
		<description>@Thomas

It is a fine line to be sure - not every private field should be exposed.  I have places where I keep a local cache in a dictionary - that shouldn&#039;t be exposed.  For me personally, my line is &quot;does component X require component/service Y to fulfill its responsibilities&quot;.  I think the component/service distinction is important, too.</description>
		<content:encoded><![CDATA[<p>@Thomas</p>
<p>It is a fine line to be sure &#8211; not every private field should be exposed.  I have places where I keep a local cache in a dictionary &#8211; that shouldn&#8217;t be exposed.  For me personally, my line is &#8220;does component X require component/service Y to fulfill its responsibilities&#8221;.  I think the component/service distinction is important, too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Eyde</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1706</link>
		<dc:creator>Thomas Eyde</dc:creator>
		<pubDate>Tue, 07 Jul 2009 11:03:12 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1706</guid>
		<description>@Mike

I will look into the Suteki code when I find the time. Sounds interesting.

And I was thinking that this is something we are forced to do when we decide to expose the DataContext. Which means our repository code now got more complex. In Suteki Shop, that&#039;s propably what you need. But for a demonstration like Nerd Dinner, that&#039;s overkill.

There is a finer point here, which I continously fail to articulate: Which types of dependencies should we expose, and which ones are ok to keep hidden? As we have seen here, some exposures come with a significant cost.

I am still of the opinion that a repository implementation is infrastructure code, while the repository contract is domain code. I don&#039;t think infrastructure implementation should leak into the domain.</description>
		<content:encoded><![CDATA[<p>@Mike</p>
<p>I will look into the Suteki code when I find the time. Sounds interesting.</p>
<p>And I was thinking that this is something we are forced to do when we decide to expose the DataContext. Which means our repository code now got more complex. In Suteki Shop, that&#8217;s propably what you need. But for a demonstration like Nerd Dinner, that&#8217;s overkill.</p>
<p>There is a finer point here, which I continously fail to articulate: Which types of dependencies should we expose, and which ones are ok to keep hidden? As we have seen here, some exposures come with a significant cost.</p>
<p>I am still of the opinion that a repository implementation is infrastructure code, while the repository contract is domain code. I don&#8217;t think infrastructure implementation should leak into the domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rock Ge</title>
		<link>http://lostechies.com/jimmybogard/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner/#comment-1705</link>
		<dc:creator>Rock Ge</dc:creator>
		<pubDate>Mon, 06 Jul 2009 23:28:53 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2009/07/03/how-not-to-do-dependency-injection-in-nerddinner.aspx#comment-1705</guid>
		<description>Great write up! Points were clear and codes are simple!

I can see NerdDinner becoming the next northwind. :)</description>
		<content:encoded><![CDATA[<p>Great write up! Points were clear and codes are simple!</p>
<p>I can see NerdDinner becoming the next northwind. <img src='http://lostechies.com/jimmybogard/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
