<?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 for Miško Hevery</title>
	<atom:link href="http://misko.hevery.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Sat, 13 Mar 2010 19:20:13 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Presentations by Other problems with Singleton - Bashar&#8217;s Blog</title>
		<link>http://misko.hevery.com/presentations/comment-page-1/#comment-3191</link>
		<dc:creator>Other problems with Singleton - Bashar&#8217;s Blog</dc:creator>
		<pubDate>Sat, 13 Mar 2010 19:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?page_id=555#comment-3191</guid>
		<description>[...] I could spent a few pages arguing and / or explaining those issues. Instead of that, I would recommend you to watch Miško Hevery&#8217;s presentations. [...]</description>
		<content:encoded><![CDATA[<p>[...] I could spent a few pages arguing and / or explaining those issues. Instead of that, I would recommend you to watch Miško Hevery&#8217;s presentations. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Static Methods are Death to Testability by misko</title>
		<link>http://misko.hevery.com/2008/12/15/static-methods-are-death-to-testability/comment-page-1/#comment-3180</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Tue, 09 Mar 2010 04:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=352#comment-3180</guid>
		<description>Hi Monoj,

My understanding of encapsulation is that only the object methods should interact with the state of the object. This is why a service object which has getters/setters breaks encapsulation. With regard to constructor I don&#039;t think it break encapsulation, as you are not allowed to modify the state of the object, you only need to provide the state/dependencies on creation. In addition the callee is does not know how to create the dependency, it asks for it likewise. 

Here is some more discussion I found online
http://stackoverflow.com/questions/1005473/must-dependency-injection-come-at-the-expense-of-encapsulation</description>
		<content:encoded><![CDATA[<p>Hi Monoj,</p>
<p>My understanding of encapsulation is that only the object methods should interact with the state of the object. This is why a service object which has getters/setters breaks encapsulation. With regard to constructor I don&#8217;t think it break encapsulation, as you are not allowed to modify the state of the object, you only need to provide the state/dependencies on creation. In addition the callee is does not know how to create the dependency, it asks for it likewise. </p>
<p>Here is some more discussion I found online<br />
<a href="http://stackoverflow.com/questions/1005473/must-dependency-injection-come-at-the-expense-of-encapsulation" rel="nofollow">http://stackoverflow.com/questions/1005473/must-dependency-injection-come-at-the-expense-of-encapsulation</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Static Methods are Death to Testability by manoj</title>
		<link>http://misko.hevery.com/2008/12/15/static-methods-are-death-to-testability/comment-page-1/#comment-3175</link>
		<dc:creator>manoj</dc:creator>
		<pubDate>Mon, 08 Mar 2010 11:41:42 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=352#comment-3175</guid>
		<description>Hi,
with regards to this and also the article about Singletons, it seems to me that you are talking in general about code that has dependecy pull. e.g.
a Class X has a process() method that goes like {
     y = new YImpl();
     y.doIt();
}
So you have a problem with testing this method since calling process() is always calling YImpl, and this cannot be changed with some other implementation. So YImpl should have been explicitly passed to process() ?

But as we pass more and more parameters, does it not break encapsulation ? There could be problems related with improper use. So somebody may be able to pass an incorrect instance of creditcardprocessor that bypasses logging/auth ?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
with regards to this and also the article about Singletons, it seems to me that you are talking in general about code that has dependecy pull. e.g.<br />
a Class X has a process() method that goes like {<br />
     y = new YImpl();<br />
     y.doIt();<br />
}<br />
So you have a problem with testing this method since calling process() is always calling YImpl, and this cannot be changed with some other implementation. So YImpl should have been explicitly passed to process() ?</p>
<p>But as we pass more and more parameters, does it not break encapsulation ? There could be problems related with improper use. So somebody may be able to pass an incorrect instance of creditcardprocessor that bypasses logging/auth ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Circular Dependency in constructors and Dependency Injection by Raghu</title>
		<link>http://misko.hevery.com/2008/08/01/circular-dependency-in-constructors-and-dependency-injection/comment-page-1/#comment-3161</link>
		<dc:creator>Raghu</dc:creator>
		<pubDate>Fri, 05 Mar 2010 12:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=146#comment-3161</guid>
		<description>nice post - came through SO.

I&#039;ve been playing with Apache wicket and ran into this problem. Here&#039;s the scenario:

PageBorder - a border component that wraps around a BasePage and does stuff like setting title, meta etc.

class PageBorder extends Border {
           public PageBorder (id, BasePage page){
                     this.page = page;
                     add (&quot;title&quot;, new Label(&quot;title&quot;, page.getTitle());
           }
}

At the same time, since the BasePage contains the PageBorder, the BasePage needs to know about the border (create the border passing this as a ctor param)
public abstract class BasePage extends Page {
             PageBorder border;
             public add (Component c) {
                       if (border == null) {
                               border = getBorder();
// subclass must create a border passing themselves in
                               add (&quot;border&quot;, border);
                        }
                        border.add(c);
             }
}


In this case, in the BasePage class, I&#039;ve put a protected method - getBorder() - so that the implementing page can decide which border to create.

While this set up works, somehow this seems smelly.

OTOH, if I look at wicket itself, seems like this mutual knowledge is rampant (Page class has a getComponent) and Component classes have a getPage() - however, the coupling is lower.

Any suggestions?</description>
		<content:encoded><![CDATA[<p>nice post &#8211; came through SO.</p>
<p>I&#8217;ve been playing with Apache wicket and ran into this problem. Here&#8217;s the scenario:</p>
<p>PageBorder &#8211; a border component that wraps around a BasePage and does stuff like setting title, meta etc.</p>
<p>class PageBorder extends Border {<br />
           public PageBorder (id, BasePage page){<br />
                     this.page = page;<br />
                     add (&#8221;title&#8221;, new Label(&#8221;title&#8221;, page.getTitle());<br />
           }<br />
}</p>
<p>At the same time, since the BasePage contains the PageBorder, the BasePage needs to know about the border (create the border passing this as a ctor param)<br />
public abstract class BasePage extends Page {<br />
             PageBorder border;<br />
             public add (Component c) {<br />
                       if (border == null) {<br />
                               border = getBorder();<br />
// subclass must create a border passing themselves in<br />
                               add (&#8221;border&#8221;, border);<br />
                        }<br />
                        border.add(c);<br />
             }<br />
}</p>
<p>In this case, in the BasePage class, I&#8217;ve put a protected method &#8211; getBorder() &#8211; so that the implementing page can decide which border to create.</p>
<p>While this set up works, somehow this seems smelly.</p>
<p>OTOH, if I look at wicket itself, seems like this mutual knowledge is rampant (Page class has a getComponent) and Component classes have a getPage() &#8211; however, the coupling is lower.</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Computer Engineer vs. Computer Scientist by jemsking</title>
		<link>http://misko.hevery.com/2009/07/11/computer-engineer-vs-computer-scientist/comment-page-1/#comment-3160</link>
		<dc:creator>jemsking</dc:creator>
		<pubDate>Fri, 05 Mar 2010 11:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=516#comment-3160</guid>
		<description>hi to all, i want to inter into the university studying computer.please i will like and expert to orientate me on what to do.i will be very grateful if someone could help me.i equally want to know the clear distingtion between a computer ingeener and a computer science.plz help</description>
		<content:encoded><![CDATA[<p>hi to all, i want to inter into the university studying computer.please i will like and expert to orientate me on what to do.i will be very grateful if someone could help me.i equally want to know the clear distingtion between a computer ingeener and a computer science.plz help</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Growing Object-Oriented Software, Guided by Tests by Witold Szczerba</title>
		<link>http://misko.hevery.com/2010/01/06/growing-object-oriented-software-guided-by-tests/comment-page-1/#comment-3154</link>
		<dc:creator>Witold Szczerba</dc:creator>
		<pubDate>Thu, 04 Mar 2010 23:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=611#comment-3154</guid>
		<description>I have read this book (one should study it actually) and I must say - it is really great! They do not repeat the usual slogans, but explain everything from scratch. They also gives many many solutions for little and big problems one can get when doing TDD.</description>
		<content:encoded><![CDATA[<p>I have read this book (one should study it actually) and I must say &#8211; it is really great! They do not repeat the usual slogans, but explain everything from scratch. They also gives many many solutions for little and big problems one can get when doing TDD.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Clean Code Talks &#8211; Inheritance, Polymorphism, &amp; Testing by Se hace camino al andar&#8230; &#187; Blog Archive &#187; Muerte al if</title>
		<link>http://misko.hevery.com/2008/12/08/clean-code-talks-inheritance-polymorphism-testing/comment-page-1/#comment-3143</link>
		<dc:creator>Se hace camino al andar&#8230; &#187; Blog Archive &#187; Muerte al if</dc:creator>
		<pubDate>Mon, 01 Mar 2010 23:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=347#comment-3143</guid>
		<description>[...] blog. Os recomiendo encarecidamente la siguiente entrada del blog de Miško Hevery titulada &#8220;Inheritance, Polymorphism, &amp; Testing&#8221; (sí, lo siento, en inglés) porque no tiene desperdicio. Tranquilos, si no os queréis [...]</description>
		<content:encoded><![CDATA[<p>[...] blog. Os recomiendo encarecidamente la siguiente entrada del blog de Miško Hevery titulada &#8220;Inheritance, Polymorphism, &amp; Testing&#8221; (sí, lo siento, en inglés) porque no tiene desperdicio. Tranquilos, si no os queréis [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ask! by panzi</title>
		<link>http://misko.hevery.com/your-suggestions/comment-page-3/#comment-3116</link>
		<dc:creator>panzi</dc:creator>
		<pubDate>Tue, 23 Feb 2010 19:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?page_id=122#comment-3116</guid>
		<description>PS: Global variables aren&#039;t known by (or cannot be expressed by) algebras, what imposes some theoretical problems on languages (or programs) that use them.</description>
		<content:encoded><![CDATA[<p>PS: Global variables aren&#8217;t known by (or cannot be expressed by) algebras, what imposes some theoretical problems on languages (or programs) that use them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Guide: Writing Testable Code by A useful rule-of-thumb for Law of Demeter violations? at Jason&#8217;s Notebook</title>
		<link>http://misko.hevery.com/code-reviewers-guide/comment-page-2/#comment-3111</link>
		<dc:creator>A useful rule-of-thumb for Law of Demeter violations? at Jason&#8217;s Notebook</dc:creator>
		<pubDate>Mon, 22 Feb 2010 18:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?page_id=310#comment-3111</guid>
		<description>[...] at things I&#8217;ve put aside during busy times.  Right now I&#8217;m finally reading through Writing Testable Code by the Google people.  It&#8217;s good, if a little Google-centric (lots of references to Guice as [...]</description>
		<content:encoded><![CDATA[<p>[...] at things I&#8217;ve put aside during busy times.  Right now I&#8217;m finally reading through Writing Testable Code by the Google people.  It&#8217;s good, if a little Google-centric (lots of references to Guice as [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Breaking the Law of Demeter is Like Looking for a Needle in the Haystack 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>
</channel>
</rss>
