<?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: Open question on dependency injection in Clojure</title>
	<atom:link href="http://tech.puredanger.com/index.php/2010/03/01/dependency-injection-clojure/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com/2010/03/01/dependency-injection-clojure/</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:39:50 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Daniel Glauser</title>
		<link>http://tech.puredanger.com/2010/03/01/dependency-injection-clojure/comment-page-1/#comment-186730</link>
		<dc:creator>Daniel Glauser</dc:creator>
		<pubDate>Sun, 07 Mar 2010 02:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/?p=802#comment-186730</guid>
		<description>Hi Alex,

I also agree with Chas, but I&#039;d like to add one thing.  I have felt for years that dependency injection and aspects were a poor man&#039;s substitute for functional programming.  Aspects are a little more powerful but I feel that if you have a language, libraries and framework that are built so they expect behavior to be passed around then you no longer need dependency injection or aspects.  In fact, a lot of the patterns that we are used to in the OO space seem to be irrelevant when working in the functional paradigm.

Regards,
Daniel</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>I also agree with Chas, but I&#8217;d like to add one thing.  I have felt for years that dependency injection and aspects were a poor man&#8217;s substitute for functional programming.  Aspects are a little more powerful but I feel that if you have a language, libraries and framework that are built so they expect behavior to be passed around then you no longer need dependency injection or aspects.  In fact, a lot of the patterns that we are used to in the OO space seem to be irrelevant when working in the functional paradigm.</p>
<p>Regards,<br />
Daniel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brenton Ashworth</title>
		<link>http://tech.puredanger.com/2010/03/01/dependency-injection-clojure/comment-page-1/#comment-186565</link>
		<dc:creator>Brenton Ashworth</dc:creator>
		<pubDate>Wed, 03 Mar 2010 04:17:09 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/?p=802#comment-186565</guid>
		<description>I have been working exclusively in Java for past 10 years and love DI when I am using Java. I understand where these questions come from because I struggled with them at first. You are trying to figure out how to write Java programs in Clojure. The fact is, you don&#039;t. In Clojure, you don&#039;t create object graphs and therefore you don&#039;t have to figure out how to mock everything. A large Clojure program will have data and functions and a small amount of explicit state management. There are very few situations where you need to do anything like mocking in Java and for that you can use Clojure&#039;s binding form.</description>
		<content:encoded><![CDATA[<p>I have been working exclusively in Java for past 10 years and love DI when I am using Java. I understand where these questions come from because I struggled with them at first. You are trying to figure out how to write Java programs in Clojure. The fact is, you don&#8217;t. In Clojure, you don&#8217;t create object graphs and therefore you don&#8217;t have to figure out how to mock everything. A large Clojure program will have data and functions and a small amount of explicit state management. There are very few situations where you need to do anything like mocking in Java and for that you can use Clojure&#8217;s binding form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://tech.puredanger.com/2010/03/01/dependency-injection-clojure/comment-page-1/#comment-186561</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/?p=802#comment-186561</guid>
		<description>I am just learn Clojure and trying to wrap my brain around it. But this is a great blog post as I too see graphs of objects being injected into Java apps. Sometimes I wonder if the Clojure community actually knows modern Java development and practices, or left years ago and I are unaware of how DI is part and parcel of most JEE development now as is testing. And with testing comes mocking. So yes, I am a newbie, and yes perhaps the light will &#039;turn on&#039; when I get it. But I also fear no one is writing real EE like apps in Clojure and it&#039;s all just another brainy academic exercise. How do you mock out things (lot of things) in Clojure? Guess (I hope) I learn...</description>
		<content:encoded><![CDATA[<p>I am just learn Clojure and trying to wrap my brain around it. But this is a great blog post as I too see graphs of objects being injected into Java apps. Sometimes I wonder if the Clojure community actually knows modern Java development and practices, or left years ago and I are unaware of how DI is part and parcel of most JEE development now as is testing. And with testing comes mocking. So yes, I am a newbie, and yes perhaps the light will &#8216;turn on&#8217; when I get it. But I also fear no one is writing real EE like apps in Clojure and it&#8217;s all just another brainy academic exercise. How do you mock out things (lot of things) in Clojure? Guess (I hope) I learn&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://tech.puredanger.com/2010/03/01/dependency-injection-clojure/comment-page-1/#comment-186518</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 02 Mar 2010 09:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/?p=802#comment-186518</guid>
		<description>The difficulty, I think, is that dependency injection is not usually just about injecting or overriding single dependencies, it&#039;s about binding graphs of values. In the simple case DI lookup seems like a map, where &quot;dataSource&quot; points to the implementation of the DataSource class. But in apps where I see, e.g. Spring being used, the DataSource implementation can itself get a connection pool injected, the pool gets a JDBC driver injected as well as individual properties for pool size, etc. The magic of DI is that if you visualize your (OO) app as a set of object graphs, you can, at runtime, replace either individual nodes or whole sub-graphs dynamically. That&#039;s really what makes it so powerful. In Java this is more or less managable because class fields and class types offer a natural way to organize the mapping of the overrides. So for me the question would be how to override any of a set of functions used within a Clojure app no matter how deep those functions are defined, without making a mess of it.</description>
		<content:encoded><![CDATA[<p>The difficulty, I think, is that dependency injection is not usually just about injecting or overriding single dependencies, it&#8217;s about binding graphs of values. In the simple case DI lookup seems like a map, where &#8220;dataSource&#8221; points to the implementation of the DataSource class. But in apps where I see, e.g. Spring being used, the DataSource implementation can itself get a connection pool injected, the pool gets a JDBC driver injected as well as individual properties for pool size, etc. The magic of DI is that if you visualize your (OO) app as a set of object graphs, you can, at runtime, replace either individual nodes or whole sub-graphs dynamically. That&#8217;s really what makes it so powerful. In Java this is more or less managable because class fields and class types offer a natural way to organize the mapping of the overrides. So for me the question would be how to override any of a set of functions used within a Clojure app no matter how deep those functions are defined, without making a mess of it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Sierra</title>
		<link>http://tech.puredanger.com/2010/03/01/dependency-injection-clojure/comment-page-1/#comment-186504</link>
		<dc:creator>Stuart Sierra</dc:creator>
		<pubDate>Tue, 02 Mar 2010 01:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/?p=802#comment-186504</guid>
		<description>I&#039;m with Chas for the most part.  Dependency Injection is a poor-man&#039;s closure.  I&#039;ve been thinking recently that using global Vars for configuration is a bad idea in a multi-threaded environment; closures with explicitly-passed parameters are more robust and flexible.</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Chas for the most part.  Dependency Injection is a poor-man&#8217;s closure.  I&#8217;ve been thinking recently that using global Vars for configuration is a bad idea in a multi-threaded environment; closures with explicitly-passed parameters are more robust and flexible.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

