<?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: PHP Dependency Injection</title>
	<atom:link href="http://www.potstuck.com/2009/01/08/php-dependency-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jun 2010 13:29:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Robert Cooke</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-171</link>
		<dc:creator>Robert Cooke</dc:creator>
		<pubDate>Sun, 16 May 2010 09:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-171</guid>
		<description>Hi,

I&#039;m using the setter injection, because I set up a very general Factory class for accessing my libraries and I wanted to keep that as simple as possible.

After reading this I&#039;m thinking of putting object specific factories between the general Factory and the objects I want to have so I can choose what to use setter/construct.

Thank you,

Robert</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m using the setter injection, because I set up a very general Factory class for accessing my libraries and I wanted to keep that as simple as possible.</p>
<p>After reading this I&#8217;m thinking of putting object specific factories between the general Factory and the objects I want to have so I can choose what to use setter/construct.</p>
<p>Thank you,</p>
<p>Robert</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ajmichels.com</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-134</link>
		<dc:creator>ajmichels.com</dc:creator>
		<pubDate>Fri, 16 Apr 2010 21:10:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-134</guid>
		<description>[...] AJ Michels on Apr.16, 2010, under Uncategorized Found this article while looking for an open source Dependency Injection engine for PHP.  The grammar needs a [...]</description>
		<content:encoded><![CDATA[<p>[...] AJ Michels on Apr.16, 2010, under Uncategorized Found this article while looking for an open source Dependency Injection engine for PHP.  The grammar needs a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: catchamonkey</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-107</link>
		<dc:creator>catchamonkey</dc:creator>
		<pubDate>Wed, 17 Mar 2010 19:50:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-107</guid>
		<description>Good article, outlines well something entirely useful and interesting.
Also, just because Zend doesn&#039;t give you a DI container, doesn&#039;t mean you can&#039;t use it in your Zend apps. Just plugin the Symfony component</description>
		<content:encoded><![CDATA[<p>Good article, outlines well something entirely useful and interesting.<br />
Also, just because Zend doesn&#8217;t give you a DI container, doesn&#8217;t mean you can&#8217;t use it in your Zend apps. Just plugin the Symfony component</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Nussio</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-104</link>
		<dc:creator>David Nussio</dc:creator>
		<pubDate>Tue, 16 Feb 2010 14:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-104</guid>
		<description>Dave,
If you want to using database with different interface you can inject into the Book a data mapper object (http://martinfowler.com/eaaCatalog/dataMapper.html) instead the Database object.</description>
		<content:encoded><![CDATA[<p>Dave,<br />
If you want to using database with different interface you can inject into the Book a data mapper object (<a href="http://martinfowler.com/eaaCatalog/dataMapper.html" rel="nofollow">http://martinfowler.com/eaaCatalog/dataMapper.html</a>) instead the Database object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Five (Good) Lessons The Government Teaches Us About Object-Oriented Programming &#124; BrandonSavage.net</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-100</link>
		<dc:creator>Five (Good) Lessons The Government Teaches Us About Object-Oriented Programming &#124; BrandonSavage.net</dc:creator>
		<pubDate>Wed, 02 Dec 2009 06:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-100</guid>
		<description>[...] who do the work are dumb; instead, the departments themselves are dependent on you giving them (dependency injection) the proper [...]</description>
		<content:encoded><![CDATA[<p>[...] who do the work are dumb; instead, the departments themselves are dependent on you giving them (dependency injection) the proper [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martijn Dijksterhuis</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-98</link>
		<dc:creator>Martijn Dijksterhuis</dc:creator>
		<pubDate>Thu, 12 Nov 2009 02:29:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-98</guid>
		<description>Thanks for sharing this. I found a mention of Dependency Injection on Brandon Savage&#039;s PHP blog; but this explains it.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing this. I found a mention of Dependency Injection on Brandon Savage&#8217;s PHP blog; but this explains it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miroslav Nikolov</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-97</link>
		<dc:creator>Miroslav Nikolov</dc:creator>
		<pubDate>Fri, 30 Oct 2009 14:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-97</guid>
		<description>Very useful, thanks.</description>
		<content:encoded><![CDATA[<p>Very useful, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Q&#38;A: Answering Some Questions About Object-Oriented Programming &#124; BrandonSavage.net</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-96</link>
		<dc:creator>Q&#38;A: Answering Some Questions About Object-Oriented Programming &#124; BrandonSavage.net</dc:creator>
		<pubDate>Fri, 30 Oct 2009 05:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-96</guid>
		<description>[...] I do not know about dependency injection – do you have any links that do not require subscription? I&#8217;ll talk about Dependency Injection here. It&#8217;s actually a really simple topic. [...]</description>
		<content:encoded><![CDATA[<p>[...] I do not know about dependency injection – do you have any links that do not require subscription? I&#8217;ll talk about Dependency Injection here. It&#8217;s actually a really simple topic. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-94</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Wed, 23 Sep 2009 08:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-94</guid>
		<description>Dave,

The idea is that database1 and database2 are both the same class, but different objects (instances).  We are not trying to write code that will fit with any interface, we only want to work with our interface.

The reason we inject the different databases is because sometimes we are using a production database to pull real data, and other times we are using a mock database to test our code.  

Injection leaves it up to US, not the class, to decide which database to use.  This gives us much greater long term flexibility as well as makes our objects loosely coupled.</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>The idea is that database1 and database2 are both the same class, but different objects (instances).  We are not trying to write code that will fit with any interface, we only want to work with our interface.</p>
<p>The reason we inject the different databases is because sometimes we are using a production database to pull real data, and other times we are using a mock database to test our code.  </p>
<p>Injection leaves it up to US, not the class, to decide which database to use.  This gives us much greater long term flexibility as well as makes our objects loosely coupled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.potstuck.com/2009/01/08/php-dependency-injection/comment-page-1/#comment-93</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 17 Sep 2009 20:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.potstuck.com/?p=66#comment-93</guid>
		<description>I understand what&#039;s going on with DI, except this. In the example of using setter injection, Ryan mentioned creating two Book objects. Book1 would have access to database1, and Book2 would have access to database2. There is one lingering question in my mind...

So, database1 and database2 are required to have the same interface? For instance, if you wanted to perform a query on database1, you might call a performQuery() function for retrieving data. With database2, the proper function might be executeQuery(). So, injecting dependencies forces rigid interface standards on the objects that are depended upon?

Or am I totally off base?</description>
		<content:encoded><![CDATA[<p>I understand what&#8217;s going on with DI, except this. In the example of using setter injection, Ryan mentioned creating two Book objects. Book1 would have access to database1, and Book2 would have access to database2. There is one lingering question in my mind&#8230;</p>
<p>So, database1 and database2 are required to have the same interface? For instance, if you wanted to perform a query on database1, you might call a performQuery() function for retrieving data. With database2, the proper function might be executeQuery(). So, injecting dependencies forces rigid interface standards on the objects that are depended upon?</p>
<p>Or am I totally off base?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
