<?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: AJAX Travelogue (Part 6): Mocking in JavaScript</title>
	<atom:link href="http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/</link>
	<description>Johannes Link's Travels through Software Devlopment Space</description>
	<pubDate>Tue, 06 Jan 2009 23:00:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: johanneslink</title>
		<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/#comment-75</link>
		<dc:creator>johanneslink</dc:creator>
		<pubDate>Tue, 16 Dec 2008 09:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://johanneslink.wordpress.com/?p=109#comment-75</guid>
		<description>Stefan, you're perfectly right in that I'd do the similar thing differently in Java. IMO the class-based and statically typed nature of Java requires that to have good decoupled code.

In JavaScript, however,  you don't have to do as much &lt;strong&gt;explicit decoupling&lt;/strong&gt; to arrive at a flexible design. Consider the global property 'Speaker'  to be the hook for plugging in your actual speaker implementation; I think of this as &lt;strong&gt;implicit decoupling&lt;/strong&gt;.

That said, I do think that most JavaScript code out there could arguably need more explicit decoupling and explicit dependencies. My example tried to mimic the way in which many of the existing libraries are coded. So, maybe you are right and I shouldn't fall into JavaScript's everything-is-public-trap.</description>
		<content:encoded><![CDATA[<p>Stefan, you&#8217;re perfectly right in that I&#8217;d do the similar thing differently in Java. IMO the class-based and statically typed nature of Java requires that to have good decoupled code.</p>
<p>In JavaScript, however,  you don&#8217;t have to do as much <strong>explicit decoupling</strong> to arrive at a flexible design. Consider the global property &#8216;Speaker&#8217;  to be the hook for plugging in your actual speaker implementation; I think of this as <strong>implicit decoupling</strong>.</p>
<p>That said, I do think that most JavaScript code out there could arguably need more explicit decoupling and explicit dependencies. My example tried to mimic the way in which many of the existing libraries are coded. So, maybe you are right and I shouldn&#8217;t fall into JavaScript&#8217;s everything-is-public-trap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Roock</title>
		<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/#comment-74</link>
		<dc:creator>Stefan Roock</dc:creator>
		<pubDate>Tue, 16 Dec 2008 09:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://johanneslink.wordpress.com/?p=109#comment-74</guid>
		<description>Hi,
in my opinion your approach is a bit odd. You try to avoid modifications to the existing code. TDD in Java leads to interfaces you need for the test. The introduction of these interfaces is seen as design enhancement.

Therefore I would modify the Java-Script-Code to make it mockable more easily. And that would mean to inject a Speaker object to the DoubleSpeaker object. Then you don't have to clean up the mess at the end of your test.

Having said that: A mock framework may be useful although. You may have to write too much test code even when you modify the testet code. But I haven't an example at hand.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
in my opinion your approach is a bit odd. You try to avoid modifications to the existing code. TDD in Java leads to interfaces you need for the test. The introduction of these interfaces is seen as design enhancement.</p>
<p>Therefore I would modify the Java-Script-Code to make it mockable more easily. And that would mean to inject a Speaker object to the DoubleSpeaker object. Then you don&#8217;t have to clean up the mess at the end of your test.</p>
<p>Having said that: A mock framework may be useful although. You may have to write too much test code even when you modify the testet code. But I haven&#8217;t an example at hand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javascript News &#187; Blog Archive &#187; MockMe: A new JavaScript mocking framework</title>
		<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/#comment-38</link>
		<dc:creator>Javascript News &#187; Blog Archive &#187; MockMe: A new JavaScript mocking framework</dc:creator>
		<pubDate>Mon, 11 Aug 2008 20:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://johanneslink.wordpress.com/?p=109#comment-38</guid>
		<description>[...] Agile fellow who wasn&#8217;t 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT [...]</description>
		<content:encoded><![CDATA[<p>[...] Agile fellow who wasn&#8217;t 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajax Girl &#187; Blog Archive &#187; MockMe: A new JavaScript mocking framework</title>
		<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/#comment-37</link>
		<dc:creator>Ajax Girl &#187; Blog Archive &#187; MockMe: A new JavaScript mocking framework</dc:creator>
		<pubDate>Mon, 11 Aug 2008 14:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://johanneslink.wordpress.com/?p=109#comment-37</guid>
		<description>[...] Agile fellow who wasn&#8217;t 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT [...]</description>
		<content:encoded><![CDATA[<p>[...] Agile fellow who wasn&#8217;t 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajaxian &#187; MockMe: A new JavaScript mocking framework</title>
		<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/#comment-36</link>
		<dc:creator>Ajaxian &#187; MockMe: A new JavaScript mocking framework</dc:creator>
		<pubDate>Mon, 11 Aug 2008 13:22:47 +0000</pubDate>
		<guid isPermaLink="false">http://johanneslink.wordpress.com/?p=109#comment-36</guid>
		<description>[...] is an Agile fellow who wasn't 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT [...]</description>
		<content:encoded><![CDATA[<p>[...] is an Agile fellow who wasn&#8217;t 100% happy with the existing JavaScript unit test frameworks, and he explained why. He gives an example: PLAIN TEXT [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AJAX Travelogue (Part 7): MockMe &#171; My Not So Private Tech Life</title>
		<link>http://blog.johanneslink.net/2008/08/08/ajax-travelogue-part-6-mocking-in-javascript/#comment-32</link>
		<dc:creator>AJAX Travelogue (Part 7): MockMe &#171; My Not So Private Tech Life</dc:creator>
		<pubDate>Sat, 09 Aug 2008 14:02:09 +0000</pubDate>
		<guid isPermaLink="false">http://johanneslink.wordpress.com/?p=109#comment-32</guid>
		<description>[...] My Not So Private Tech Life Johannes Link&#8217;s Travels through Software Devlopment Space      &#171; AJAX Travelogue (Part 6): Mocking in&#160;JavaScript [...]</description>
		<content:encoded><![CDATA[<p>[...] My Not So Private Tech Life Johannes Link&#8217;s Travels through Software Devlopment Space      &laquo; AJAX Travelogue (Part 6): Mocking in&nbsp;JavaScript [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
