<?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: Breaking the Law of Demeter is Like Looking for a Needle in the Haystack</title>
	<atom:link href="http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Fri, 30 Jul 2010 03:59:03 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dependency Injection and Reference Passing &#171; Dark Views</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-3777</link>
		<dc:creator>Dependency Injection and Reference Passing &#171; Dark Views</dc:creator>
		<pubDate>Wed, 21 Jul 2010 17:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-3777</guid>
		<description>[...] Software developers are paid for their brains. If something feels wrong, it usually is. Most of the early code we come up with then starting with DI violates the Law of Demeter. [...]</description>
		<content:encoded><![CDATA[<p>[...] Software developers are paid for their brains. If something feels wrong, it usually is. Most of the early code we come up with then starting with DI violates the Law of Demeter. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-3107</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Mon, 22 Feb 2010 04:14:25 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-3107</guid>
		<description>@Aleemb,

Which one do you think is better? I think this one is way more truthful and gives the reader a better view to what is going on:
Mechanic(Engine e, Chassis c, Body b, Gearbox g, Paint p)

But I think you are trying to say, that there is way to much in the constructor, and I agree for you, so you should group them to logical groups and have
Mechanic(Powertrain p, Chassis c, Body b, Pain p);

But this example is a little flawed, since to make a mechanic you don&#039;t should not need a car and paint, So I think the example you wanted to do was
Car(Powertrain p, Chassis c, Body b, Pain p);</description>
		<content:encoded><![CDATA[<p>@Aleemb,</p>
<p>Which one do you think is better? I think this one is way more truthful and gives the reader a better view to what is going on:<br />
Mechanic(Engine e, Chassis c, Body b, Gearbox g, Paint p)</p>
<p>But I think you are trying to say, that there is way to much in the constructor, and I agree for you, so you should group them to logical groups and have<br />
Mechanic(Powertrain p, Chassis c, Body b, Pain p);</p>
<p>But this example is a little flawed, since to make a mechanic you don&#8217;t should not need a car and paint, So I think the example you wanted to do was<br />
Car(Powertrain p, Chassis c, Body b, Pain p);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aleemb</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-3106</link>
		<dc:creator>aleemb</dc:creator>
		<pubDate>Sun, 21 Feb 2010 14:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-3106</guid>
		<description>Which is better of the following two?

Mechanic(Engine e, Chassis c, Body b, Gearbox g, Paint p)
Mechanic(Context ctx)

What if Context has 9  classes and Mechanic requires 7?</description>
		<content:encoded><![CDATA[<p>Which is better of the following two?</p>
<p>Mechanic(Engine e, Chassis c, Body b, Gearbox g, Paint p)<br />
Mechanic(Context ctx)</p>
<p>What if Context has 9  classes and Mechanic requires 7?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Symfony versus The Law Of Demeter: does Symfony promote bad habits?</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-2298</link>
		<dc:creator>Symfony versus The Law Of Demeter: does Symfony promote bad habits?</dc:creator>
		<pubDate>Mon, 09 Nov 2009 12:03:40 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-2298</guid>
		<description>[...] dynamite the whole project, if they saw some typical Symfony code. One of the authors of the post, Miško Hevery, writes on his blog: Every time I see Law of Demeter violation I imagine a haystack where the code is desperately [...]</description>
		<content:encoded><![CDATA[<p>[...] dynamite the whole project, if they saw some typical Symfony code. One of the authors of the post, Miško Hevery, writes on his blog: Every time I see Law of Demeter violation I imagine a haystack where the code is desperately [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: All About Google &#187; How to think about OO</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-2031</link>
		<dc:creator>All About Google &#187; How to think about OO</dc:creator>
		<pubDate>Tue, 06 Oct 2009 15:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-2031</guid>
		<description>[...] The problem here is the method may as well be static! It is in the wrong place, and you can tell this because it does not interact with any of the data in the Database, instead it interacts with the data in cache which it fetches by calling the getObjects() method. My guess is that this method belongs to one of its arguments most likely Cache. If you move it to Cache you well notice that the Cache will no longer need the getObjects() method since the for loop can access the internal state of the Cache directly. Hey, we simplified the code (moved one method, deleted one method) and we have made Demeter happy. [...]</description>
		<content:encoded><![CDATA[<p>[...] The problem here is the method may as well be static! It is in the wrong place, and you can tell this because it does not interact with any of the data in the Database, instead it interacts with the data in cache which it fetches by calling the getObjects() method. My guess is that this method belongs to one of its arguments most likely Cache. If you move it to Cache you well notice that the Cache will no longer need the getObjects() method since the for loop can access the internal state of the Cache directly. Hey, we simplified the code (moved one method, deleted one method) and we have made Demeter happy. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to think about OO</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-1548</link>
		<dc:creator>How to think about OO</dc:creator>
		<pubDate>Fri, 07 Aug 2009 15:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-1548</guid>
		<description>[...] The problem here is the method may as well be static! It is in the wrong place, and you can tell this because it does not interact with any of the data in the Database, instead it interacts with the data in cache which it fetches by calling the getObjects() method. My guess is that this method belongs to one of its arguments most likely Cache. If you move it to Cache you well notice that the Cache will no longer need the getObjects() method since the for loop can access the internal state of the Cache directly. Hey, we simplified the code (moved one method, deleted one method) and we have made Demeter happy. [...]</description>
		<content:encoded><![CDATA[<p>[...] The problem here is the method may as well be static! It is in the wrong place, and you can tell this because it does not interact with any of the data in the Database, instead it interacts with the data in cache which it fetches by calling the getObjects() method. My guess is that this method belongs to one of its arguments most likely Cache. If you move it to Cache you well notice that the Cache will no longer need the getObjects() method since the for loop can access the internal state of the Cache directly. Hey, we simplified the code (moved one method, deleted one method) and we have made Demeter happy. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: German</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-552</link>
		<dc:creator>German</dc:creator>
		<pubDate>Sun, 11 Jan 2009 16:11:03 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-552</guid>
		<description>I guess it would be OK to call a method of a parameter, if that is a method that actually does work. In this scenario the method is a mere getter and the  context isn&#039;t really needed, to keep its reference or  to do any actual work: it is needed just to get hold of an engine! So it is clear to me that, LoD notwithstanding, Context is a bad idea in this example.</description>
		<content:encoded><![CDATA[<p>I guess it would be OK to call a method of a parameter, if that is a method that actually does work. In this scenario the method is a mere getter and the  context isn&#8217;t really needed, to keep its reference or  to do any actual work: it is needed just to get hold of an engine! So it is clear to me that, LoD notwithstanding, Context is a bad idea in this example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: My Unified Theory of Bugs &#124; Miško Hevery</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-345</link>
		<dc:creator>My Unified Theory of Bugs &#124; Miško Hevery</dc:creator>
		<pubDate>Mon, 17 Nov 2008 23:36:20 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-345</guid>
		<description>[...] separation between classes (Testable Seems) &#8211;&gt; clear separation between classes makes it less likely that a wiring problem is [...]</description>
		<content:encoded><![CDATA[<p>[...] separation between classes (Testable Seems) &#8211;&gt; clear separation between classes makes it less likely that a wiring problem is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nWizard - Norbert Rakosi&#8217;s blog on Free Software development &#8230; JAVA &#8230; Personal Development&#8230; and &#8230; bad speling&#8230; &#187; Breaking the Law of Demeter&#8230;</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-326</link>
		<dc:creator>nWizard - Norbert Rakosi&#8217;s blog on Free Software development &#8230; JAVA &#8230; Personal Development&#8230; and &#8230; bad speling&#8230; &#187; Breaking the Law of Demeter&#8230;</dc:creator>
		<pubDate>Thu, 06 Nov 2008 07:50:21 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-326</guid>
		<description>[...] Following this today I rad into an interesting article called Dependency Injection Myth: Reference Passing which lead me to another interesting reading: Breaking the Law of Demeter is Like Looking for a Needle in the Haystack. [...]</description>
		<content:encoded><![CDATA[<p>[...] Following this today I rad into an interesting article called Dependency Injection Myth: Reference Passing which lead me to another interesting reading: Breaking the Law of Demeter is Like Looking for a Needle in the Haystack. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pass Around Ginormous Context Objects &#124; Miško Hevery</title>
		<link>http://misko.hevery.com/2008/07/18/breaking-the-law-of-demeter-is-like-looking-for-a-needle-in-the-haystack/comment-page-1/#comment-304</link>
		<dc:creator>Pass Around Ginormous Context Objects &#124; Miško Hevery</dc:creator>
		<pubDate>Mon, 27 Oct 2008 21:28:17 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=99#comment-304</guid>
		<description>[...] to know it is interested in all of these!&#8221; Why is this a problem? as discussed in &#8216;Breaking the Law of Demeter is Like Looking for a Needle in the Haystack&#8216; When you ask for things explicitly it makes it easy to pass in test-doubles for these [...]</description>
		<content:encoded><![CDATA[<p>[...] to know it is interested in all of these!&#8221; Why is this a problem? as discussed in &#8216;Breaking the Law of Demeter is Like Looking for a Needle in the Haystack&#8216; When you ask for things explicitly it makes it easy to pass in test-doubles for these [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
