<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ketan&#039;s Musings</title>
	<atom:link href="http://ketan.padegaonkar.name/feed" rel="self" type="application/rss+xml" />
	<link>http://ketan.padegaonkar.name</link>
	<description>Where he blogs about his eclipse musings</description>
	<lastBuildDate>Fri, 04 Sep 2009 07:09:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tell, Don&#8217;t Ask &#8211; Part 2</title>
		<link>http://ketan.padegaonkar.name/2009/09/04/tell-dont-ask-part-2.html</link>
		<comments>http://ketan.padegaonkar.name/2009/09/04/tell-dont-ask-part-2.html#comments</comments>
		<pubDate>Fri, 04 Sep 2009 02:46:42 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clean-code]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[mocks]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=404</guid>
		<description><![CDATA[Objects exposing behavior, not state
Controlling complexity of your codebase by limiting what state your objects expose
The more objects that can see and change states on other objects, the more complex your system. Objects returning a boolean mean that someone calling that method will use an if branch, returning an integer would mean someone using if/else [...]]]></description>
			<content:encoded><![CDATA[<h2>Objects exposing behavior, not state</h2>
<h3>Controlling complexity of your codebase by limiting what state your objects expose</h3>
<p>The more objects that can see and change states on other objects, the more complex your system. Objects returning a boolean mean that someone calling that method will use an if branch, returning an integer would mean someone using if/else or switch/case. Returning objects would mean introspeting that returned object to invoke something else on it. This increases coupling between classes, makes code hard to read and test.</p>
<h3>My class has 3 friends, I talk to my friends&#8217; friends. My friends are difficult to mock, therefore mocking sucks&#8230;</h3>
<p>&#8230; well, yeah!</p>
<p>Testing procedural code is hard. Testing such code generally involves setting up &#8220;data&#8221; and asserting on state of objects. <a href="http://www.c2.com/cgi/wiki?TellDontAsk">Tell Don&#8217;t Ask</a> code on the other hand is easier to test since you&#8217;re not testing state. Also notice how DI makes things simpler to test.</p>
<pre>
void testOwnerCanFeedDog(){
    Dog dog = new Dog();
    // have to create a mouth since owner calls dog.getMouth() to feed it
    Mouth mouth = new Mouth();
    dog.setMouth(mouth);
    PetOwner owner = new PetOwner();
    owner.setDog(dog);
    owner.feedDog(food);

    // verify that the dog gets the food (well the mouth, actually)
    assertEquals(food, mouth.getFood());
}
</pre>
<pre>
void testOwnerCanFeedDog(){
    Dog dog = mock(Dog.class);
    PetOwner owner = new PetOwner(dog);
    owner.feed(food);

    // verify that the dog gets the food
    verify(dog).feed(food);
}
</pre>
<p>Without <a href="http://martinfowler.com/articles/injection.html">Dependency Injection</a>, testing is quite difficult; without <a href="http://www.c2.com/cgi/wiki?TellDontAsk">Tell Don&#8217;t Ask</a>, testing is almost always impossible. Put together, things are separated, testing is simplified.</p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/09/04/tell-dont-ask-part-2.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tell, Don&#8217;t Ask &#8211; Part 1</title>
		<link>http://ketan.padegaonkar.name/2009/09/04/tell-dont-ask-part-1.html</link>
		<comments>http://ketan.padegaonkar.name/2009/09/04/tell-dont-ask-part-1.html#comments</comments>
		<pubDate>Fri, 04 Sep 2009 02:40:41 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[clean-code]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[mocks]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=371</guid>
		<description><![CDATA[I spend more time reading code than writing it. I therefore like code that is readable. Rarely do I like to read code that is verbose and does too much orchestration in order to do something that is orthognal to what I&#8217;m looking for.
Code is easier to read and maintain when objects are written in [...]]]></description>
			<content:encoded><![CDATA[<p>I spend more time reading code than writing it. I therefore like code that is readable. Rarely do I like to read code that is verbose and does too much orchestration in order to do something that is orthognal to what I&#8217;m looking for.</p>
<p>Code is easier to read and maintain when objects are written in a <a href="http://www.c2.com/cgi/wiki?TellDontAsk">Tell Don&#8217;t Ask</a>.</p>
<p>&#8220;Tell, Don&#8217;t Ask&#8221; is a style of programming where anObject tells anotherObject to doSomething(), rather than asking anotherObject to getSomeValue() and then makeADecision().</p>
<p>Code that does violates this this is more procedural than it is object oriented. In the procedural world code is written to fetch some data (or state) and then make a decision or perform some action. Procedural programming &#8220;pulls data&#8221; into the logic to get things done.</p>
<p>In object oriented programming, we do the opposite &#8212; have objects do something for you instead of you doing it yourself. Don&#8217;t overdo this too much, someone still has to do the real work though <img src='http://ketan.padegaonkar.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Identifying places where you may tell instead of ask:</p>
<pre>
class PetOwner{
    void feedDog(Food food){
        if(getDog().isHungry()){
            dog.getMouth().putFood(food);
        }
    }
}
</pre>
<p>This can instead be written as:</p>
<pre>
class PetOwner{
    void feedDog(Food food){
        dog.feed(food);
    }
}

class Dog{
    void feed(Food food){
        if (iAmHungry()){
            // consume food
        }
    }
}
</pre>
<p>Notice how the PetOwner does not know (or care to know) about the fact that the dog has a mouth.</p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/09/04/tell-dont-ask-part-1.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Code Coverage And Functional Tests</title>
		<link>http://ketan.padegaonkar.name/2009/08/26/code-coverage-and-functional-tests.html</link>
		<comments>http://ketan.padegaonkar.name/2009/08/26/code-coverage-and-functional-tests.html#comments</comments>
		<pubDate>Wed, 26 Aug 2009 04:04:03 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code coverage]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[functional testing]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=390</guid>
		<description><![CDATA[I am often asked this rather perilous question:
How do I view code coverage for my functional tests?
Short answer:
Here&#8217;s how&#8230;. However, use it only for figuring out what functionality is not covered, not as a workaround for not having enough unit and integrations.
Having to use functional tests to determine percentage of code coverage is IMO a [...]]]></description>
			<content:encoded><![CDATA[<p>I am often asked this rather perilous question:</p>
<blockquote><p>How do I view code coverage for my functional tests?</p></blockquote>
<p>Short answer:</p>
<blockquote><p>Here&#8217;s how&#8230;. However, use it only for figuring out what functionality is not covered, not as a workaround for not having enough unit and integrations.</p></blockquote>
<p>Having to use functional tests to determine percentage of code coverage is IMO a bad smell, avoid as much as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/08/26/code-coverage-and-functional-tests.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GEF Support for SWTBot</title>
		<link>http://ketan.padegaonkar.name/2009/08/04/gef-support-for-swtbot.html</link>
		<comments>http://ketan.padegaonkar.name/2009/08/04/gef-support-for-swtbot.html#comments</comments>
		<pubDate>Tue, 04 Aug 2009 02:20:33 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[gef]]></category>
		<category><![CDATA[swtbot]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=388</guid>
		<description><![CDATA[A long pending request from swtbot users has been support for GEF. The SWTBot4GEF project was created as a sandbox to see how feasible things were in the GEF world.
Mariot Chauvin recently polished the initial contribution from David Green and released a version 0.1 of the gef support. We&#8217;re working towards integrating this as part [...]]]></description>
			<content:encoded><![CDATA[<p>A long pending request from swtbot users has been <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=269609">support for GEF</a>. <a href="http://code.google.com/p/swtbot4gef/">The SWTBot4GEF project</a> was created as a sandbox to see how feasible things were in the GEF world.</p>
<p><a href="http://mariot-thoughts.blogspot.com/">Mariot Chauvin</a> recently polished the initial contribution from <a href="http://greensopinion.blogspot.com/search/label/SWTBot">David Green</a> and released a version 0.1 of the gef support. We&#8217;re working towards integrating this as part of swtbot and you should hear more about it once the IP process is done <img src='http://ketan.padegaonkar.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/08/04/gef-support-for-swtbot.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWTBot Getting Started Video Tutorials</title>
		<link>http://ketan.padegaonkar.name/2009/07/15/swtbot-getting-started-video-tutorials.html</link>
		<comments>http://ketan.padegaonkar.name/2009/07/15/swtbot-getting-started-video-tutorials.html#comments</comments>
		<pubDate>Tue, 14 Jul 2009 19:21:33 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[swtbot]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=369</guid>
		<description><![CDATA[Getting started with SWTBot is a unique experience for a lot of users, and myself. Unlike most other projects hosted at eclipse.org, it&#8217;s a UI testing tool written for primarily for testers to be able to write automated tests.
In this regard the users of swtbot are a bit special. Most of them understand testing and [...]]]></description>
			<content:encoded><![CDATA[<p>Getting started with SWTBot is a unique experience for a lot of users, and myself. Unlike most other projects hosted at eclipse.org, it&#8217;s a UI testing tool written for primarily for testers to be able to write automated tests.</p>
<p>In this regard the users of swtbot are a bit special. Most of them understand testing and the principles associated with testing but do not necessarily understand swt, threading models and the workbench and platform internals. Getting such users to use eclipse, create test plugins and write tests in java involves more than just documentation and screenshots.</p>
<p>Mohammed recently posted two such 5 minute videos. <a href="http://download.eclipse.org/technology/swtbot/docs/videos/beginners/SWTBotGettingStartedIn5Minutes/">Getting started with swtbot</a> in under 5 minutes, and run your <a href="http://download.eclipse.org/technology/swtbot/docs/videos/beginners/SWTBotHeadlessTestingForNovices/">UI tests in a headless build</a> from within ant.</p>
<p>A video is worth a thousand images <img src='http://ketan.padegaonkar.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/07/15/swtbot-getting-started-video-tutorials.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Just upgraded my blog to a newer wordpress&#8230;</title>
		<link>http://ketan.padegaonkar.name/2009/07/15/just-upgraded-my-blog-to-a-newer-wordpress.html</link>
		<comments>http://ketan.padegaonkar.name/2009/07/15/just-upgraded-my-blog-to-a-newer-wordpress.html#comments</comments>
		<pubDate>Tue, 14 Jul 2009 18:34:21 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/2009/07/15/just-upgraded-my-blog-to-a-newer-wordpress.html</guid>
		<description><![CDATA[&#8230; and just wanted to see all the parts are still moving.
]]></description>
			<content:encoded><![CDATA[<p>&#8230; and just wanted to see all the parts are still moving.</p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/07/15/just-upgraded-my-blog-to-a-newer-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipsetasy! Time to throw away the dope&#8230;</title>
		<link>http://ketan.padegaonkar.name/2009/06/19/eclipsetasy-time-to-throw-away-the-dope.html</link>
		<comments>http://ketan.padegaonkar.name/2009/06/19/eclipsetasy-time-to-throw-away-the-dope.html#comments</comments>
		<pubDate>Fri, 19 Jun 2009 06:10:27 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[swtbot]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=366</guid>
		<description><![CDATA[&#8230; and move to newer dope&#8230;
I just realized that I had about 58 eclipse SDKs downloaded on my hard drive and 22 instances of different versions of eclipse. That was a whooping 9GB for the sdk downloads and 6.5GB for the extracted versions. Time to move to newer dope  
Similar was the case on [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; and move to newer dope&#8230;</p>
<p>I just realized that I had about 58 eclipse SDKs downloaded on my hard drive and 22 instances of different versions of eclipse. That was a whooping 9GB for the sdk downloads and 6.5GB for the extracted versions. Time to move to <a href="http://www.eclipse.org/galileo/">newer dope</a> <img src='http://ketan.padegaonkar.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Similar was the case on the <a href="http://cruise.thoughtworks.com">cruise based build grid</a> that tested <a href="http://eclipse.org/swtbot">SWTBot</a> from all versions starting from eclipse 3.2 upwards to the latest RC build on all platforms &#8212; linux-gtk/linux-gtk-64/win32/macosx-carbon.</p>
<div id="attachment_367" class="wp-caption alignnone" style="width: 955px"><a href="http://ketan.padegaonkar.name/files/2009/06/eclipse-installs.png"><img src="http://ketan.padegaonkar.name/files/2009/06/eclipse-installs.png" alt="Eclipsetasy" width="945" height="660" class="size-full wp-image-367" /></a>
<p class="wp-caption-text">Eclipsetasy</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/06/19/eclipsetasy-time-to-throw-away-the-dope.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Galileo DemoCamp Pune</title>
		<link>http://ketan.padegaonkar.name/2009/06/08/eclipse-galileo-democamp-pune.html</link>
		<comments>http://ketan.padegaonkar.name/2009/06/08/eclipse-galileo-democamp-pune.html#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:07:06 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[democamp]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[galileo]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/2009/06/08/eclipse-galileo-democamp-pune.html</guid>
		<description><![CDATA[A reminder to those following Planet Eclipse that there&#8217;s a Galileo DemoCamp in Pune on Saturday, 13th June 2009. Sign up on the wiki page so that the ThoughtWorks Pune office is stuffed with enough food to feed you  

An Eclipse DemoCamp is a congregation of Eclipse enthusiasts to meet up and demo what [...]]]></description>
			<content:encoded><![CDATA[<p>A reminder to those following Planet Eclipse that there&#8217;s a Galileo DemoCamp in Pune on Saturday, 13th June 2009. <a href="http://wiki.eclipse.org/Eclipse_DemoCamps_Galileo_2009/Pune">Sign up</a> on the wiki page so that the ThoughtWorks Pune office is stuffed with enough food to feed you <img src='http://ketan.padegaonkar.name/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<blockquote><p>
An Eclipse DemoCamp is a congregation of Eclipse enthusiasts to meet up and demo what they are doing with Eclipse. The demos can be of research projects, Eclipse open source projects, applications based on Eclipse, commercial products using Eclipse or whatever you think might be of interest to the attendees. The only stipulation is that it must be Eclipse related.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/06/08/eclipse-galileo-democamp-pune.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Updates slowing you down ?</title>
		<link>http://ketan.padegaonkar.name/2009/06/03/eclipse-updates-slowing-you-down.html</link>
		<comments>http://ketan.padegaonkar.name/2009/06/03/eclipse-updates-slowing-you-down.html#comments</comments>
		<pubDate>Wed, 03 Jun 2009 10:26:05 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[p2]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=358</guid>
		<description><![CDATA[There&#8217;s a joke about maven downloading half the internet. Apparently p2 talks to the other half maven does not download.
Earlier you&#8217;d go get a coffee every time you clicked the eclipse update manager. With the eclipse servers taking a beating and download speeds really going slow you better grab lunch.
But wait there&#8217;s another nifty &#8220;hack&#8221;: [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a joke about maven downloading half the internet. Apparently p2 talks to the other half maven does not download.</p>
<p>Earlier you&#8217;d go get a coffee every time you clicked the eclipse update manager. With the eclipse servers <a href="http://dev.eclipse.org/mhonarc/lists/eclipse.org-committers/msg00766.html">taking a beating</a> and download speeds really going slow you better grab lunch.</p>
<p>But wait there&#8217;s another nifty &#8220;hack&#8221;: Don&#8217;t talk to the eclipse servers.</p>
<p>To make the p2 update manager faster (assuming you aren&#8217;t downloading from the eclipse mirror sites):</p>
<ul>
<li>Edit your hosts file (/etc/hosts or c:\windows\system32\drivers\etc\hosts)</li>
<li>Add a fake alias for the download server:
<pre>
127.0.0.10 download.eclipse.org
</pre>
</li>
</ul>
<p>Open the update manager again, enjoy the amazing speeds, remember to remove the line if you indeed want to talk to the eclipse servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/06/03/eclipse-updates-slowing-you-down.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing a new release of SWTBot</title>
		<link>http://ketan.padegaonkar.name/2009/05/29/announcing-a-new-release-of-swtbot.html</link>
		<comments>http://ketan.padegaonkar.name/2009/05/29/announcing-a-new-release-of-swtbot.html#comments</comments>
		<pubDate>Fri, 29 May 2009 12:34:46 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[swt]]></category>
		<category><![CDATA[swtbot]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=352</guid>
		<description><![CDATA[You can download the latest and greatest from the SWTBot download page.
A listing of some of the new features available:
Bug 263036 &#8211; SWTBot finally has an icon that was missing since two years!
Bug 269919 &#8211; Added support for toggle buttons
Bug 271246 &#8211; Better support for handling editors. This should serve as a good start towards [...]]]></description>
			<content:encoded><![CDATA[<p>You can download the latest and greatest from the <a href="http://www.eclipse.org/swtbot/downloads.php">SWTBot download page</a>.</p>
<p>A listing of some of the new features available:</p>
<p><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=263036">Bug 263036</a> &#8211; SWTBot finally has an icon that was missing since two years!<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=269919">Bug 269919</a> &#8211; Added support for toggle buttons<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=271246">Bug 271246</a> &#8211; Better support for handling editors. This should serve as a good start towards providing support for multipage, forms based editors<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=271132">Bug 271132</a> &#8211; Using Display#post() to support sending native click events instead of fake events. This is still work in progress and not all widgets support native events yet.<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=273624">Bug 273624</a> &#8211; Use native keyboard events for typing. SWTBot currently defaults to using AWT robot. SWT&#8217;s Dispay#post() is available as well &#8212; it is however buggy across platforms and swt versions. Since SWTBot uses native keyboard events, it needs to understand various <a href="http://wiki.eclipse.org/SWTBot/Keyboard_Layouts">Keyboard Layouts</a>.<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=267189">Bug 267189</a> &#8211; Support capturing screenshots of widgets.<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=277093">Bug 277093</a> &#8211; Support for Link widgets.</p>
<p>There are also a lot of minor bugs that were fixed in this release.</p>
]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/05/29/announcing-a-new-release-of-swtbot.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
