<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19487847</id><updated>2011-07-30T09:27:14.302-07:00</updated><title type='text'>Ruby experiences</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19487847.post-114536047724016881</id><published>2006-04-18T04:39:00.000-07:00</published><updated>2006-04-18T04:41:17.276-07:00</updated><title type='text'>Pay attention to what you ask for</title><content type='html'>&lt;p&gt;I have been busy debugging stuff on my rails project. I had a horrendous performance issue caused because I was retrieving way too much informaiton when I did &lt;code&gt;x.find()&lt;/code&gt;. The development.log generated by rails is a god send to debug that stuff.&lt;/p&gt;&lt;p&gt;When you run into performance issues, it turns out that most of the time, rails does the right thing. If you putz around with the arguments to find and endup being greedy, thats when you get bitten in the ****.&lt;/p&gt;&lt;p&gt;The other cool thing I ended up using for this implementation is &lt;code&gt;before_save&lt;/code&gt;() handler to allow me to do a webservice request while saving some data. That is so cool because now I dont have to track down all the places where save is being called or worse, implement save in the model.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-114536047724016881?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/114536047724016881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=114536047724016881&amp;isPopup=true' title='42 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/114536047724016881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/114536047724016881'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2006/04/pay-attention-to-what-you-ask-for.html' title='Pay attention to what you ask for'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>42</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113647819891468110</id><published>2006-01-05T08:22:00.000-08:00</published><updated>2006-01-05T08:23:18.930-08:00</updated><title type='text'>has-and-belongs-to-many with multiselect listboxes</title><content type='html'>&lt;p&gt;If you have played with habtm in RoR, you might have encountered a need a provide a list that the user can select from. Usually, you would use a list of checkboxes to provide such a thing. Check out &lt;a href="http://wiki.rubyonrails.com/rails/pages/CheckboxHABTM/versions/12"&gt;http://wiki.rubyonrails.com/rails/pages/CheckboxHABTM/versions/12&lt;/a&gt; which shows a way to render such a thing.&lt;/p&gt;&lt;p&gt;But, It is a bit unweildy if you have long list that a user can select from, say, list of all cities in a state. In that case, I used a multi-select list box to provide such an implementation.&lt;/p&gt;&lt;p&gt;To generate the code, use the following method in your helpers. It basically takes 5 arguments, collection_name is a name for the collection that can be used in the controller, list_selections provides the collection of all possible selections, current_selections provides the current selection in the model, value_method is the method for the value, and text_method is the method for the text that can be called on the object contained within current_selections. Note that current_selections should have "include?" method implemented to determine the current selection.&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;def multi_select_collection(collection_name, list_selections, current_selections,value_method,text_method)&lt;br/&gt;result = "&amp;lt;select name='#{collection_name}[]' multiple size=5&amp;gt;\n"&lt;br/&gt;list_selections.each do |l|&lt;br/&gt;result &amp;lt;&amp;lt; "&amp;lt;option value='#{l.send(value_method)}'"&lt;br/&gt;result &amp;lt;&amp;lt; " selected " if current_selections.include?(l)&lt;br/&gt;result &amp;lt;&amp;lt; "/&amp;gt; #{l.send(text_method)} &amp;lt;/option&amp;gt;\n"&lt;br/&gt;end&lt;br/&gt;result &amp;lt;&amp;lt; "&amp;lt;/select&amp;gt;\n"&lt;br/&gt;return result&lt;br/&gt;end&lt;/span&gt;&lt;/p&gt;&lt;p&gt;You might have to reformat it if you cut&amp;amp;paste since my blog might have wrapped it.&lt;br/&gt;&lt;/p&gt;&lt;hr/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113647819891468110?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113647819891468110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113647819891468110&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113647819891468110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113647819891468110'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2006/01/has-and-belongs-to-many-with.html' title='has-and-belongs-to-many with multiselect listboxes'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113458937207464885</id><published>2005-12-14T11:41:00.000-08:00</published><updated>2005-12-14T11:42:52.093-08:00</updated><title type='text'>Rails is 1.0</title><content type='html'>&lt;p&gt;Finally &lt;a href="http://www.rubyonrails.org/"&gt;Rails is 1.0 product&lt;/a&gt;. If only I can convince my managers to use this for internal apps!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113458937207464885?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113458937207464885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113458937207464885&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113458937207464885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113458937207464885'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/rails-is-10.html' title='Rails is 1.0'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113444619751414605</id><published>2005-12-12T19:55:00.000-08:00</published><updated>2005-12-12T19:56:37.853-08:00</updated><title type='text'>Changing app names in Ruby on rails</title><content type='html'>&lt;p&gt;There is no trick to changing the application name from say "iteration" to "story"... Just search for iteration in all file names (because, Rails basically looks for controller based on the name and then maps it to the helper and the views) and replace them. Thats it. No funky tiles-config.xml to change or to re-deploy to yet another way... Rails is a beautiful thing!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113444619751414605?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113444619751414605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113444619751414605&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113444619751414605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113444619751414605'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/changing-app-names-in-ruby-on-rails.html' title='Changing app names in Ruby on rails'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113442746937407446</id><published>2005-12-12T14:43:00.000-08:00</published><updated>2005-12-12T14:44:29.383-08:00</updated><title type='text'>Dependency breaking techniques from Michael Feathers book</title><content type='html'>&lt;p&gt;This has nothing to do with Ruby as such. But I needed a place to keep this checklist of &lt;a href="http://www.zoundry.com/z/p/1/1392/0/556ED47A/170" target="_blank" rel="nofollow" title="Working Effectively with Legacy Code"&gt;Working Effectively with Legacy Code&lt;/a&gt; interesting Dependency breaking techniques.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.zoundry.com/z/p/1/1392/0/556ED47A/170" target="_blank" rel="nofollow" title="Working Effectively with Legacy Code"&gt;&lt;img src="http://images.amazon.com/images/P/0131177052.01._SCMZZZZZZZ_.jpg" align="left" title="Working Effectively with Legacy Code" style="CLEAR: left; MARGIN: 2px 8px 2px 2px" alt="Working Effectively with Legacy Code"/&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-SIZE: 0.75em"&gt;&lt;strong&gt;Adapt parameter&lt;/strong&gt; - Shim Wrapper class around a awkward collobarator. Think HttpServletRequest...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Break out method object&lt;/strong&gt; - Move large method to a class of its own with the local variables as the instance variables of the class and the method's argument initially is the host class. What is the point? It now helps us re-factor that class to expose its innards for extracting interfaces..&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Expose static method&lt;/strong&gt; - If the code under test does not need instance variables or methods to execute, expose that code as static and now you can test it lot more easily.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Extract and override call, factory method, getter&lt;/strong&gt; - All about moving the awkword collobarator code into a method of its own and overriding it using subclass in test.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Extract implementer&lt;/strong&gt; - Primarily for creation of clear names, push code from perfectly named class down one level and make the current class an interface.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Extract interface -&lt;/strong&gt; Use tool support if available, safest way to break dependency. We saw problems where there are hierachies of objects and abstract classes in between current class and Object. Probably, Extract Implementer.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Introduce instance delegator -&lt;/strong&gt; Basically useful for breaking dependency on a awkword static method. Create a instance method with same signature as the static and delegate. Replace the calls to static method with the instance delegator.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Introduce static setter -&lt;/strong&gt; Seems like a way to get around static methods to work with singletons (such in Service classes). Basically, you need a static setter and make the c'tor for the object protected. Then we can construct the object by deriving off of the main object and setting that as the value of the singleton under test.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Parameterize constructor -&lt;/strong&gt; Allow passing in objects that are normally created within the object. AKA Dependency injection.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Parameterize methods -&lt;/strong&gt; pass in as arguments, objects that are used within a method.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Primitivize parameter -&lt;/strong&gt; Basically move the code around so that the actual logic getting executed is using primitive types (ints, longs or in Java some of the primitive objects). Dangerous since eventhough it gets code to test, exposes internal details, duplicates data and also prolongs the problem.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Pull up feature&lt;/strong&gt;: Useful if you have class that has dependencies that causes problem when instantiated because of dependencies. Pull up the class of methods to be tested to a superclass and derive the old class from this new super class. Test class also derives from the new super class and now you have access to those methods and can instantiated cleanly.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Push down dependency&lt;/strong&gt;: This is similar to extract interface or subclass and override. Here we push down the problematic dependencies down to a subclass. This is opposite to pull up in that in pull up we are trying to get the methods out of the current class because there are many other methods that cant be tested because of dependencies and in push down, there are only few dependencies that are specific to some collobrarator that can be pushed down. This might need the callers to be modified.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Subclass and override&lt;/strong&gt;: extention of extract and override.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113442746937407446?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113442746937407446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113442746937407446&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113442746937407446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113442746937407446'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/dependency-breaking-techniques-from.html' title='Dependency breaking techniques from Michael Feathers book'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113388793822881191</id><published>2005-12-06T08:51:00.000-08:00</published><updated>2005-12-06T08:52:18.250-08:00</updated><title type='text'>HumaneInterface, Ruby and TDD</title><content type='html'>&lt;p&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;I&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;just read the new entry By Martin Fowler about &lt;a href="http://martinfowler.com/bliki/HumaneInterface.html"&gt;HumaneInteraces&lt;/a&gt;. Its pointing out that the Ruby language developers paid attention to end user need and came up with convienience methods even though it did cause bit of a method explosion&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;. &lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;He used&lt;/span&gt;&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;Array &lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;class &lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;and contrasted with&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;java.util.List&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;interface. I agree with his post&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: Verdana, 'Trebuchet MS',Helvetica, Arial, sans-serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;I would like to add to that test driven development tends to lead towards humane&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; interfaces (The part about being having convinience methods be part of the object signature). I think that is because developers will end up thinking of a method to&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; implement as part of the functionality and that is usually based on the input we usually consider for that method.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;For example, lets say that you need to implement a method that would retrieve some information about an employee. We start off with a test with a method on the class, say,&lt;/span&gt;&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;findEmployee(String name).&lt;/span&gt; Because, as humans, we tend to write code starting with the input and it usually is from a name.. Then we find out that the underlying collaborator (say EmployeeDAL) accepts only IDs. Now you endup with another method, say &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;findEmployee(int id)..&lt;/span&gt; At this point, you endup with another method &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;findIdForEmployee(String name).&lt;/span&gt; We can potentially remove the &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;findEmployee(String name)&lt;/span&gt; since it can be achieved through a combination of &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;findIdForEmployee&lt;/span&gt; + &lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;findEmployee(id).&lt;/span&gt; I contend that we should leave the earlier method as is since it provides a convenient interface to the caller.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-FAMILY: 'Courier New', Courier, monospace"&gt;&lt;span style="FONT-FAMILY: 'Times New Roman', Georgia, serif"&gt;My 2c..&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113388793822881191?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113388793822881191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113388793822881191&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113388793822881191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113388793822881191'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/humaneinterface-ruby-and-tdd.html' title='HumaneInterface, Ruby and TDD'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113386766356973716</id><published>2005-12-06T03:14:00.000-08:00</published><updated>2005-12-06T03:14:23.580-08:00</updated><title type='text'>WS-* in Ruby</title><content type='html'>&lt;p&gt;Keith Brown has just posted a &lt;a href="http://pluralsight.com/blogs/keith/archive/2005/12/05/17282.aspx"&gt;WS-policy implementation in Ruby&lt;/a&gt;. Nice! Does this make Ruby more and more a main-stream language for MS? Also, I wonder why Ruby is getting such an attention from Microsoft camp compared to, say, python?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113386766356973716?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113386766356973716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113386766356973716&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113386766356973716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113386766356973716'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/ws-in-ruby.html' title='WS-* in Ruby'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113354606166208640</id><published>2005-12-02T09:53:00.000-08:00</published><updated>2005-12-02T09:54:21.686-08:00</updated><title type='text'>BeautifulSoup and Ruby</title><content type='html'>&lt;p&gt;I have been writing some simple script that would take a word HTML table and take out all that gunk attributes within the html leaving out only pure TR and TD elements. If you want to ask, I am doing this so that our &lt;a href="http://fit.c2.com/"&gt;FIT&lt;/a&gt; tables become a bit thinner. This also gave me a way to play with Ruby a bit&lt;/p&gt;&lt;p&gt;So, I looked around for a good parser for the HTML. I found &lt;a href="http://www.crummy.com/software/BeautifulSoup/"&gt;BeautifulSoup&lt;/a&gt; &lt;a href="http://www.crummy.com/software/RubyfulSoup/"&gt;port for Ruby&lt;/a&gt;. This is is truly a screenscraping parser but works beautifully. The coolest thing is that it allows for malformed HTML.&lt;/p&gt;&lt;p&gt;This is great.&lt;/p&gt;&lt;p&gt;yield keyword in Ruby, combined with "&amp;amp;" and .call are awesome.&lt;/p&gt;&lt;p&gt;Oh, I have started using &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; as my primary IDE for my ruby development and it helps a lot since it allows writing and running &lt;a href="http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/index.html"&gt;Test::Unit&lt;/a&gt; a breeze.&lt;/p&gt;&lt;p&gt;All in all, woohoo!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113354606166208640?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113354606166208640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113354606166208640&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113354606166208640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113354606166208640'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/beautifulsoup-and-ruby.html' title='BeautifulSoup and Ruby'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113347238296407116</id><published>2005-12-01T13:26:00.000-08:00</published><updated>2005-12-01T13:26:22.976-08:00</updated><title type='text'>Rails, Ruby, Eclipse</title><content type='html'>&lt;p&gt;Whoohoo, Search and ye shall find. I found this "&lt;a href="http://www.developertesting.com/archives/month200510/20051006-RubyEclipseAndALinkToRemember.html"&gt;Ruby, Rails, Eclipse and a Link to Remember&lt;/a&gt;" which lead me to &lt;a href="http://www.napcs.com/howto/railsonwindows.html"&gt;Setting up a Rails Development Environment on Windows Using Eclipse&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Now I can finally use my 2nd favorite IDE for all my Ruby work. Awesome, I can see my emacs-lisp code withering away slowly...&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113347238296407116?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113347238296407116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113347238296407116&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113347238296407116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113347238296407116'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/rails-ruby-eclipse.html' title='Rails, Ruby, Eclipse'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113346957527206725</id><published>2005-12-01T12:39:00.000-08:00</published><updated>2005-12-01T12:39:35.286-08:00</updated><title type='text'>Ruby is fantastic</title><content type='html'>&lt;p&gt;Some of the links I have been visiting..&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://wiki.rubyonrails.com/rails"&gt;Rails Wiki&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.ruby-doc.org/"&gt;Ruby Docs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.ruby-doc.org/docs/ProgrammingRuby/"&gt;Programming Ruby Book&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113346957527206725?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113346957527206725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113346957527206725&amp;isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113346957527206725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113346957527206725'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/ruby-is-fantastic.html' title='Ruby is fantastic'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113345474807456727</id><published>2005-12-01T08:32:00.000-08:00</published><updated>2005-12-01T08:32:28.080-08:00</updated><title type='text'>I am using Zoundry</title><content type='html'>&lt;p&gt;I am trying out &lt;a href="http://www.zoundry.com/"&gt;zoundry&lt;/a&gt; for editing my posts. Hopefully, this will work better than others I have tried so far.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113345474807456727?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113345474807456727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113345474807456727&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113345474807456727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113345474807456727'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/i-am-using-zoundry.html' title='I am using Zoundry'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19487847.post-113345418229153690</id><published>2005-12-01T08:21:00.000-08:00</published><updated>2005-12-01T08:23:02.300-08:00</updated><title type='text'>I will post my ruby experiences here</title><content type='html'>I needed a place to post my experience with Ruby and Rails stuff. I have been having a blast learning this stuff. Just thought, why not have a place for my thoughts....&lt;br /&gt;:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19487847-113345418229153690?l=rubyexperiences.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rubyexperiences.blogspot.com/feeds/113345418229153690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19487847&amp;postID=113345418229153690&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113345418229153690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19487847/posts/default/113345418229153690'/><link rel='alternate' type='text/html' href='http://rubyexperiences.blogspot.com/2005/12/i-will-post-my-ruby-experiences-here.html' title='I will post my ruby experiences here'/><author><name>Girish Bharadwaj</name><uri>http://www.blogger.com/profile/15458065030900924097</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
