<?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: Not so poor man&#8217;s dependency injection</title>
	<atom:link href="http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/</link>
	<description>adventures in extreme programming</description>
	<lastBuildDate>Thu, 15 Jul 2010 11:34:19 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Carsten</title>
		<link>http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/comment-page-1/#comment-10588</link>
		<dc:creator>Carsten</dc:creator>
		<pubDate>Sat, 27 Feb 2010 15:27:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=1082#comment-10588</guid>
		<description>I like the Poor Man&#039;s IoC and whenever I stumble upon legacy code that has a lot of dependencies I&#039;m tempted to refactor it to use this way of IoC. It&#039;s an easy way to have testable code, and you get to good results very often. Unfortunatly I&#039;ve come upon many places where this isn&#039;t used and where is no room for refactorings, so I have to live with the untestable code or twist myself in various ways to get to a meaningful test.</description>
		<content:encoded><![CDATA[<p>I like the Poor Man&#8217;s IoC and whenever I stumble upon legacy code that has a lot of dependencies I&#8217;m tempted to refactor it to use this way of IoC. It&#8217;s an easy way to have testable code, and you get to good results very often. Unfortunatly I&#8217;ve come upon many places where this isn&#8217;t used and where is no room for refactorings, so I have to live with the untestable code or twist myself in various ways to get to a meaningful test.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Fernandes</title>
		<link>http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/comment-page-1/#comment-9091</link>
		<dc:creator>Daniel Fernandes</dc:creator>
		<pubDate>Tue, 19 Jan 2010 08:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=1082#comment-9091</guid>
		<description>*I actually don’t have a huge amount of experience with IoC containers, but that’s because like Uncle Bob,  I’ve always tried to avoid them until absolutely necessary, however I do have first hand reports (within orgs I’ve worked for) of where IoC abuse has caused very expensive problems.

That rings a bell and it&#039;s painful to both my ears.</description>
		<content:encoded><![CDATA[<p>*I actually don’t have a huge amount of experience with IoC containers, but that’s because like Uncle Bob,  I’ve always tried to avoid them until absolutely necessary, however I do have first hand reports (within orgs I’ve worked for) of where IoC abuse has caused very expensive problems.</p>
<p>That rings a bell and it&#8217;s painful to both my ears.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Fernandes</title>
		<link>http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/comment-page-1/#comment-9076</link>
		<dc:creator>Daniel Fernandes</dc:creator>
		<pubDate>Mon, 18 Jan 2010 18:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=1082#comment-9076</guid>
		<description>Dependency Inversion Principle, really, should be the important principle that we should care about.
Dependency Injection is merely a simple technique that is built around limitations of platforms based around statically typed languages.

Poor Man Dependency Injection like you&#039;re doing is detrimental, I think, to understanding what a class really does. Ideally I (not considering inheritance) should only have to check its public members to gain such knowledge, here by having a public default ctor, anyone using this class will have too too check this default ctor and therefore its implementation details.

And as Tim mentioned, IoC can indeed hide a lot of complexity with large object graphs. And to that I&#039;d say that if the business focused part (ie, not the technical parts) of your system is that complex then you need to split it and use for instance messaging to avoid the Big Ball Of Mud syndrome.

Daniel</description>
		<content:encoded><![CDATA[<p>Dependency Inversion Principle, really, should be the important principle that we should care about.<br />
Dependency Injection is merely a simple technique that is built around limitations of platforms based around statically typed languages.</p>
<p>Poor Man Dependency Injection like you&#8217;re doing is detrimental, I think, to understanding what a class really does. Ideally I (not considering inheritance) should only have to check its public members to gain such knowledge, here by having a public default ctor, anyone using this class will have too too check this default ctor and therefore its implementation details.</p>
<p>And as Tim mentioned, IoC can indeed hide a lot of complexity with large object graphs. And to that I&#8217;d say that if the business focused part (ie, not the technical parts) of your system is that complex then you need to split it and use for instance messaging to avoid the Big Ball Of Mud syndrome.</p>
<p>Daniel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/comment-page-1/#comment-9074</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Mon, 18 Jan 2010 16:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=1082#comment-9074</guid>
		<description>Hi Tim!

Your example of a Repository pattern implimentation sounds like a situation which justifies use of an IoC (however if you&#039;re having to pass around lots of dependencies between collaborators it can often point to a code smell). 

My point is not that you shouldn&#039;t use IoC containers, just that you should think very carefully before you do and not be afraid of using poor man&#039;s DI when it&#039;s the more appropriate solution.</description>
		<content:encoded><![CDATA[<p>Hi Tim!</p>
<p>Your example of a Repository pattern implimentation sounds like a situation which justifies use of an IoC (however if you&#8217;re having to pass around lots of dependencies between collaborators it can often point to a code smell). </p>
<p>My point is not that you shouldn&#8217;t use IoC containers, just that you should think very carefully before you do and not be afraid of using poor man&#8217;s DI when it&#8217;s the more appropriate solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Ross</title>
		<link>http://blog.robbowley.net/2010/01/18/not-so-poor-mans-dependency-injection/comment-page-1/#comment-9070</link>
		<dc:creator>Tim Ross</dc:creator>
		<pubDate>Mon, 18 Jan 2010 14:55:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.robbowley.net/?p=1082#comment-9070</guid>
		<description>Hi Rob, the problem with poor man&#039;s dependency injection in my experience is it gets very messy when your dependencies have dependencies. For example, a controller that takes a repository that takes a session. The construction get&#039;s pretty chaotic and you have no control over the scope of an instance of a dependency. Using an IoC container will supply dependencies to the entire object graph and allow you to control the life cycle of objects. I tend to inject  objects that I consider to be external collaborators, such as services, repositories, etc. In saying that, I have seen IoC usage get out of control, mainly when the container is treated as a service locator. Using an IoC with DI forces you to consider which objects you collaborate with, rather than making direct calls to the container. By carefully naming the interfaces you inject, it is easy to identify the roles and responsibilities of your collaborators.</description>
		<content:encoded><![CDATA[<p>Hi Rob, the problem with poor man&#8217;s dependency injection in my experience is it gets very messy when your dependencies have dependencies. For example, a controller that takes a repository that takes a session. The construction get&#8217;s pretty chaotic and you have no control over the scope of an instance of a dependency. Using an IoC container will supply dependencies to the entire object graph and allow you to control the life cycle of objects. I tend to inject  objects that I consider to be external collaborators, such as services, repositories, etc. In saying that, I have seen IoC usage get out of control, mainly when the container is treated as a service locator. Using an IoC with DI forces you to consider which objects you collaborate with, rather than making direct calls to the container. By carefully naming the interfaces you inject, it is easy to identify the roles and responsibilities of your collaborators.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
