<?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: Defending Dependency Injection</title>
	<atom:link href="http://kohari.org/2007/08/15/defending-dependency-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://kohari.org/2007/08/15/defending-dependency-injection/</link>
	<description>Organized chaos</description>
	<pubDate>Fri, 05 Sep 2008 19:13:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: The Inquisitive Coder &#187; Blog Archive &#187; Dependency Injection discussion</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-56</link>
		<dc:creator>The Inquisitive Coder &#187; Blog Archive &#187; Dependency Injection discussion</dc:creator>
		<pubDate>Sat, 17 May 2008 19:10:08 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-56</guid>
		<description>[...] those of testability. Ayende then posted a good reply to it. Nate Kohari also has an excellent post defending [...]</description>
		<content:encoded><![CDATA[<p>[...] those of testability. Ayende then posted a good reply to it. Nate Kohari also has an excellent post defending [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-03-30 &#124; Lazycoder</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-55</link>
		<dc:creator>links for 2008-03-30 &#124; Lazycoder</dc:creator>
		<pubDate>Sun, 30 Mar 2008 10:35:25 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-55</guid>
		<description>[...] Defending Dependency Injection at Discord&#38;Rhyme (tags: dependencyinjection design Development lazycoder) [...]</description>
		<content:encoded><![CDATA[<p>[...] Defending Dependency Injection at Discord&#38;Rhyme (tags: dependencyinjection design Development lazycoder) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 依赖注入是否值得？ - 自由、创新、研究、探索…… - 博客园</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-51</link>
		<dc:creator>依赖注入是否值得？ - 自由、创新、研究、探索…… - 博客园</dc:creator>
		<pubDate>Mon, 17 Dec 2007 00:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-51</guid>
		<description>[...] Nate Kohari也回答了Proffitt的原帖。Kohari不但给出了一个DI的代码示例，还详细阐述了什么是真正的DI：  如果你是GoF的爱好者，这其实就是Strategy模式。依赖注入（按照我的观点）本质上是大规模使用的Strategy模式。 [...]</description>
		<content:encoded><![CDATA[<p>[...] Nate Kohari也回答了Proffitt的原帖。Kohari不但给出了一个DI的代码示例，还详细阐述了什么是真正的DI：  如果你是GoF的爱好者，这其实就是Strategy模式。依赖注入（按照我的观点）本质上是大规模使用的Strategy模式。 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Wong</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-27</link>
		<dc:creator>Kevin Wong</dc:creator>
		<pubDate>Sun, 09 Dec 2007 05:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-27</guid>
		<description>Okay, this is the part where I'm a dick, but if you read and understand the theory of DI and still don't appreciate its elegance, power and simplicity, you've got bigger problems than unit testing.  20  years of industry study and practical experience have culminated in several key tenets of good software design, including: simplicity, separation of concerns, loose coupling, transparency.  DI delivers on all of these.

Simplicity:
It seems Jacob is under the misguided notion that DI makes software MORE complex.  I have architected 5 commercial projects using DI spanning various domains, and I have found the opposite to be true.  If I'm writing a service and find that it needs a new dependency, I simply add a property and start using it.  Consider what this means; the entirety of a service's dependency code is a single property declaration statement.  No simpler design can be imagined.

Separation of Concerns:
DI separates and modularizes the concern of application object construction and wiring.  This concern would otherwise be scattered throughout the code; not good.  This is similar to the way AOP modularizes cross-cutting concerns.  A large DI method or DI XML definition file might initially seem complex, but it's all the same stuff: construction and wiring, i.e., it is highly cohesive.  Those that use DI undoubtedly find it liberating to no longer have to worry about dependency management, as it's all done in one place in one way.  Thus, we are left to focus unfettered on our business problems.

Loose Coupling:
DI does not directly make code more loosely coupled, but it makes substantially easier practices that do, e.g., developing to interfaces.

Transparency:
The argument that DI breaks encapsulation is erroneous.  Encapsulation refers to the hiding of design decisions that don't need to be known to outsiders.  If we're operating at the level of a class, we NEED TO KNOW the types it depends on.  DI makes these dependencies explicit and transparent.  If the goal is encapsulation on a larger scope, one should look to technologies like OSGi.

Not only does DI deliver on all of these, but I would argue that on average it does so in fewer lines of code.  So, the question is: Why wouldn't you use DI on every project?</description>
		<content:encoded><![CDATA[<p>Okay, this is the part where I&#8217;m a dick, but if you read and understand the theory of DI and still don&#8217;t appreciate its elegance, power and simplicity, you&#8217;ve got bigger problems than unit testing.  20  years of industry study and practical experience have culminated in several key tenets of good software design, including: simplicity, separation of concerns, loose coupling, transparency.  DI delivers on all of these.</p>
<p>Simplicity:<br />
It seems Jacob is under the misguided notion that DI makes software MORE complex.  I have architected 5 commercial projects using DI spanning various domains, and I have found the opposite to be true.  If I&#8217;m writing a service and find that it needs a new dependency, I simply add a property and start using it.  Consider what this means; the entirety of a service&#8217;s dependency code is a single property declaration statement.  No simpler design can be imagined.</p>
<p>Separation of Concerns:<br />
DI separates and modularizes the concern of application object construction and wiring.  This concern would otherwise be scattered throughout the code; not good.  This is similar to the way AOP modularizes cross-cutting concerns.  A large DI method or DI XML definition file might initially seem complex, but it&#8217;s all the same stuff: construction and wiring, i.e., it is highly cohesive.  Those that use DI undoubtedly find it liberating to no longer have to worry about dependency management, as it&#8217;s all done in one place in one way.  Thus, we are left to focus unfettered on our business problems.</p>
<p>Loose Coupling:<br />
DI does not directly make code more loosely coupled, but it makes substantially easier practices that do, e.g., developing to interfaces.</p>
<p>Transparency:<br />
The argument that DI breaks encapsulation is erroneous.  Encapsulation refers to the hiding of design decisions that don&#8217;t need to be known to outsiders.  If we&#8217;re operating at the level of a class, we NEED TO KNOW the types it depends on.  DI makes these dependencies explicit and transparent.  If the goal is encapsulation on a larger scope, one should look to technologies like OSGi.</p>
<p>Not only does DI deliver on all of these, but I would argue that on average it does so in fewer lines of code.  So, the question is: Why wouldn&#8217;t you use DI on every project?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Why use Dependency Injection? &#171; CodeForNothing</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-53</link>
		<dc:creator>Why use Dependency Injection? &#171; CodeForNothing</dc:creator>
		<pubDate>Sun, 11 Nov 2007 18:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-53</guid>
		<description>[...] And this is a response to the article above which eventually reaches some common ground. Read the comments for the whole story: http://kohari.org/2007/08/15/defending-dependency-injection/#comment-950 [...]</description>
		<content:encoded><![CDATA[<p>[...] And this is a response to the article above which eventually reaches some common ground. Read the comments for the whole story: <a href="http://kohari.org/2007/08/15/defending-dependency-injection/#comment-950" rel="nofollow">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-950</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Gentile</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-52</link>
		<dc:creator>Steve Gentile</dc:creator>
		<pubDate>Mon, 08 Oct 2007 17:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-52</guid>
		<description>I think that DI and IoC is a fantastic way to build pluggable component based architectures.

Great write up and I think you have a good handle on the value of DI.

I think a great example is how Windsor can also control the lifecycle of your components.  Additionally, Windsor as an IoC brings in other aspects, such as EventWiring, AoP interceptors, etc...

What this means Jacob is that the lightweight container can do more than just 'create' your objects.

Take a typical Pub - Sub.  With an IoC, you can register your publisher and subscriber's in the configuration.  If you need to add a new one, or remove one.  You edit a config file.

Windsor can create and objects, start up the publisher, and help facilitate the event handling.

If you have ever done deployment releases of code or worked on a team, these type of code changes can introduce bugs, etc...

There is alot of value, and of course understanding how DI helps that is important.  It's value comes when you have code that is built with interfaces where you can use polymorphisms and interchange your components.

thanks again for the blog post.</description>
		<content:encoded><![CDATA[<p>I think that DI and IoC is a fantastic way to build pluggable component based architectures.</p>
<p>Great write up and I think you have a good handle on the value of DI.</p>
<p>I think a great example is how Windsor can also control the lifecycle of your components.  Additionally, Windsor as an IoC brings in other aspects, such as EventWiring, AoP interceptors, etc&#8230;</p>
<p>What this means Jacob is that the lightweight container can do more than just &#8216;create&#8217; your objects.</p>
<p>Take a typical Pub - Sub.  With an IoC, you can register your publisher and subscriber&#8217;s in the configuration.  If you need to add a new one, or remove one.  You edit a config file.</p>
<p>Windsor can create and objects, start up the publisher, and help facilitate the event handling.</p>
<p>If you have ever done deployment releases of code or worked on a team, these type of code changes can introduce bugs, etc&#8230;</p>
<p>There is alot of value, and of course understanding how DI helps that is important.  It&#8217;s value comes when you have code that is built with interfaces where you can use polymorphisms and interchange your components.</p>
<p>thanks again for the blog post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Altiere &#187; Learning Dependency Injection</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-26</link>
		<dc:creator>Jack Altiere &#187; Learning Dependency Injection</dc:creator>
		<pubDate>Thu, 30 Aug 2007 02:43:13 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-26</guid>
		<description>[...] seeing that video, and reading&#160;an interesting article and discussion&#160;about the topic, I decided it was time for me to jump right in.&#160; I&#8217;m going to use a [...]</description>
		<content:encoded><![CDATA[<p>[...] seeing that video, and reading&nbsp;an interesting article and discussion&nbsp;about the topic, I decided it was time for me to jump right in.&nbsp; I&#8217;m going to use a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pazu</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-54</link>
		<dc:creator>Pazu</dc:creator>
		<pubDate>Sun, 26 Aug 2007 22:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-54</guid>
		<description>Helpful discussion! Anyway I have to say, that DI/pattern provider/plugin (or how you call it) is in my eyes just direct consequence of coding againts interface and ability to dynamically create objects. Usefull for plugins and non-short-sighted design. But for unit testing (=simple and elementary) ? I find DI requiring so much housekeeping and de-capsulation, that for me it is real TDD showstopper ! In light of this I am interested in TypeMock, since it might allow me to keep TDD overhead low and skip the bar I wasn't able to skip till now.</description>
		<content:encoded><![CDATA[<p>Helpful discussion! Anyway I have to say, that DI/pattern provider/plugin (or how you call it) is in my eyes just direct consequence of coding againts interface and ability to dynamically create objects. Usefull for plugins and non-short-sighted design. But for unit testing (=simple and elementary) ? I find DI requiring so much housekeeping and de-capsulation, that for me it is real TDD showstopper ! In light of this I am interested in TypeMock, since it might allow me to keep TDD overhead low and skip the bar I wasn&#8217;t able to skip till now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Embracing Change at Discord&#38;Rhyme</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-50</link>
		<dc:creator>Embracing Change at Discord&#38;Rhyme</dc:creator>
		<pubDate>Wed, 22 Aug 2007 00:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-50</guid>
		<description>[...] dependency injection debate has continued to rage. Jacob posted a reply to Ayende&#8217;s two posts, which Ayende then [...]</description>
		<content:encoded><![CDATA[<p>[...] dependency injection debate has continued to rage. Jacob posted a reply to Ayende&#8217;s two posts, which Ayende then [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli Lopian&#8217;s Blog (TypeMock) &#187; Blog Archive &#187; Dependency Injection - Keep your privates to yourself</title>
		<link>http://kohari.org/2007/08/15/defending-dependency-injection/#comment-25</link>
		<dc:creator>Eli Lopian&#8217;s Blog (TypeMock) &#187; Blog Archive &#187; Dependency Injection - Keep your privates to yourself</dc:creator>
		<pubDate>Tue, 21 Aug 2007 10:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://kohari.org/2007/08/15/defending-dependency-injection/#comment-25</guid>
		<description>[...] applicability outside of Unit Testing&#8221;&#160;post, the discussion continues with Nate Kohari response post&#160;and Jacobs counter post. Oren has also joined in with two [...]</description>
		<content:encoded><![CDATA[<p>[...] applicability outside of Unit Testing&#8221;&nbsp;post, the discussion continues with Nate Kohari response post&nbsp;and Jacobs counter post. Oren has also joined in with two [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
