<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Professional PHP &#187; dependency-injection</title>
	<atom:link href="http://www.procata.com/blog/archives/tag/dependency-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.procata.com/blog</link>
	<description>PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.</description>
	<lastBuildDate>Fri, 10 Dec 2010 17:23:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dependency Injection in PHP</title>
		<link>http://www.procata.com/blog/archives/2006/06/26/dependency-injection-in-php/</link>
		<comments>http://www.procata.com/blog/archives/2006/06/26/dependency-injection-in-php/#comments</comments>
		<pubDate>Tue, 27 Jun 2006 04:17:53 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Agile Methods]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[dependency-injection]]></category>
		<category><![CDATA[php-architect]]></category>
		<category><![CDATA[phparch]]></category>

		<guid isPermaLink="false">http://www.procata.com/blog/archives/2006/06/26/dependency-injection-in-php/</guid>
		<description><![CDATA[The June issue of PHP Architect is out.  My column this month is on dependency injection, a topic which I&#8217;ve been warming up to lately.
First there was CORBA.  Then insane complexity of CORBA was supplanted by the intolerable complexity of EJB.  Influenced by an agile mindset and the power of Unit testing, [...]]]></description>
			<content:encoded><![CDATA[<p>The June issue of <a href="http://www.phparch.com/issue.php?mid=82">PHP Architect</a> is out.  My column this month is on dependency injection, a topic which I&#8217;ve been warming up to lately.</p>
<p>First there was <a href="http://acmqueue.com/modules.php?name=Content&#038;pa=showpage&#038;pid=396">CORBA</a>.  Then insane complexity of CORBA was supplanted by the intolerable complexity of <a href="http://acmqueue.com/modules.php?name=Content&#038;pa=showpage&#038;pid=398">EJB</a>.  Influenced by an agile mindset and the power of Unit testing, a group of java programmers began to construct simpler alternatives to EJB.  Thus, the inversion of control frameworks were born.  Martin Fowler came along, clarified and renamed the pattern <a href="http://www.martinfowler.com/articles/injection.html">dependency injection</a>.  This activity has originated in the Java world, but the pattern applies in PHP as well.</p>
<p>It is heartening to see an industry solve a problem over the course of a decade, moving from complex vendor driven middle-ware to simple patterns.  The thing I like most about DI is how dead simple it really is.</p>
<p>Fowler&#8217;s article is a must read on the topic. However, I have two problems with most of the introductions to dependency injection.  One is the use of irrelevant girl kisses boy style examples.  The other is the over-emphasis on the container.  The whole point of dependency injection is to move away from invasive component architectures, such as EJB.  From my point of view, it is far more interesting to explore what impact dependency injection has on your design than what features your container has.</p>
<p>With that in mind, I tried to write an introduction to dependency injection that avoiding talking about DI containers and that tried to use real, relevant examples.  For an example, I started with a typical, run of the mill dependency, torn from a popular PHP library that shall remain nameless, but easy to guess.  Then I build on that with a plug-able backend in a common PHP style and then again using dependency injection.</p>
<p>For me dependency injection is relatively new territory, but one that I feel is an important technique.  I&#8217;d like to see this technique become more widespread in PHP, especially in the current crop of frameworks.</p>
<p>I have a significant bias, but I think you should <a href="http://www.phparch.com/issue.php?mid=82">read the article</a>.  I hope you find it useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.procata.com/blog/archives/2006/06/26/dependency-injection-in-php/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

