<?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: Can&#8217;t test that Singleton? Try Dependency Injection!</title>
	<atom:link href="http://www.androidsx.com/cant-test-that-singleton-try-dependency-injection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.androidsx.com/cant-test-that-singleton-try-dependency-injection/</link>
	<description>Our Android apps and much more!</description>
	<lastBuildDate>Mon, 26 Jul 2010 15:16:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pablo Pera Mira</title>
		<link>http://www.androidsx.com/cant-test-that-singleton-try-dependency-injection/comment-page-1/#comment-685</link>
		<dc:creator>Pablo Pera Mira</dc:creator>
		<pubDate>Wed, 07 Jul 2010 21:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.androidsx.com/?p=60#comment-685</guid>
		<description>But most likely those 20 classes only need access to specific objects/services that the server provides. So you would inject only what they really need (following the Law of Demeter). This way, they are not even aware of the server class, which might come in handy in a future refactoring.

Still, sometimes there are trade-offs to make. What can easily happen with dependency injection is that your constructors end up having too many arguments. Another problem is that some classes are just forwarding objects that they don&#039;t even need to others.

To alleviate this, you can &quot;start the dependency injection later&quot;: let a selected group of central classes get the server instance, and inject from there.

Not sure I made my point. It&#039;s sort of difficult to explain without an example and with my limited literary skills :)</description>
		<content:encoded><![CDATA[<p>But most likely those 20 classes only need access to specific objects/services that the server provides. So you would inject only what they really need (following the Law of Demeter). This way, they are not even aware of the server class, which might come in handy in a future refactoring.</p>
<p>Still, sometimes there are trade-offs to make. What can easily happen with dependency injection is that your constructors end up having too many arguments. Another problem is that some classes are just forwarding objects that they don&#8217;t even need to others.</p>
<p>To alleviate this, you can &#8220;start the dependency injection later&#8221;: let a selected group of central classes get the server instance, and inject from there.</p>
<p>Not sure I made my point. It&#8217;s sort of difficult to explain without an example and with my limited literary skills <img src='http://www.androidsx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://www.androidsx.com/cant-test-that-singleton-try-dependency-injection/comment-page-1/#comment-684</link>
		<dc:creator>david</dc:creator>
		<pubDate>Wed, 07 Jul 2010 19:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.androidsx.com/?p=60#comment-684</guid>
		<description>Dependency injection to mock singleton ?
A Very bypassing solution.
If the singleton is central and you need the singleton in 20 classes of your application, you will add the dependency in the 20 classes ?
You can but you make your design heavier.</description>
		<content:encoded><![CDATA[<p>Dependency injection to mock singleton ?<br />
A Very bypassing solution.<br />
If the singleton is central and you need the singleton in 20 classes of your application, you will add the dependency in the 20 classes ?<br />
You can but you make your design heavier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Top 10 Best Selling Walkie Talkies and Reviews</title>
		<link>http://www.androidsx.com/cant-test-that-singleton-try-dependency-injection/comment-page-1/#comment-290</link>
		<dc:creator>Top 10 Best Selling Walkie Talkies and Reviews</dc:creator>
		<pubDate>Sat, 29 May 2010 14:20:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.androidsx.com/?p=60#comment-290</guid>
		<description>&lt;strong&gt;...&lt;/strong&gt;

Your point is valueble for me. Thanks. Could you please suggest the suitable 5 mile walkie talkie info！...</description>
		<content:encoded><![CDATA[<p><strong>&#8230;</strong></p>
<p>Your point is valueble for me. Thanks. Could you please suggest the suitable 5 mile walkie talkie info！&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
