<?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:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5434273264113727929</id><updated>2010-07-25T17:16:27.715-05:00</updated><title type='text'>Effective Programming</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default?start-index=26&amp;max-results=25'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-3465603020016851359</id><published>2010-07-25T10:03:00.004-05:00</published><updated>2010-07-25T10:08:29.176-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mercurial'/><category scheme='http://www.blogger.com/atom/ns#' term='joel-on-software'/><category scheme='http://www.blogger.com/atom/ns#' term='hg'/><title type='text'>Mercurial HG on the wiki</title><content type='html'>I spent the better part of the morning reading about &lt;a href="http://mercurial.selenic.com/"&gt;hg&lt;/a&gt; from &lt;a href="http://hginit.com/"&gt;Joel's&lt;/a&gt; tutorial. Check &lt;a href="http://wiki.effectiveprogramming.com/index.php?title=Mercurial_HG"&gt;my notes&lt;/a&gt; if you're interested in a quick &lt;a href="http://mercurial.selenic.com/wiki"&gt;hg reference&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-3465603020016851359?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/3465603020016851359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=3465603020016851359&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3465603020016851359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3465603020016851359'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/07/mercurial-hg-on-wiki.html' title='Mercurial HG on the wiki'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-4401250335717620842</id><published>2010-06-27T23:56:00.001-05:00</published><updated>2010-06-27T23:57:16.958-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='recursion'/><category scheme='http://www.blogger.com/atom/ns#' term='binary-search'/><category scheme='http://www.blogger.com/atom/ns#' term='search'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>Worse Case time complexity for binary search</title><content type='html'>&lt;p&gt;If we represent the time complexity of Binary Search as&lt;/p&gt;
&lt;code&gt;W(n) = W(&lt;sup&gt;n&lt;/sup&gt;&amp;frasl;&lt;sub&gt;2&lt;/sub&gt;) + 1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Prove the following:&lt;/p&gt;
&lt;code&gt;W(n) = floor(lg n) + 1&lt;/code&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-4401250335717620842?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/4401250335717620842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=4401250335717620842&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4401250335717620842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4401250335717620842'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/06/worse-case-time-complexity-for-binary.html' title='Worse Case time complexity for binary search'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-8669884271411580217</id><published>2010-03-09T19:02:00.003-06:00</published><updated>2010-07-25T07:54:53.131-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='springmvc'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>Spring MVC Walkthroughs</title><content type='html'>&lt;p&gt;2 &lt;em&gt;must-have&lt;/em&gt; links for Spring MVC:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html"&gt;Spring MVC Step By Step&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://blog.springsource.com/2009/12/21/mvc-simplifications-in-spring-3-0/"&gt;MVC Simplifications in 3.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-8669884271411580217?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/8669884271411580217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=8669884271411580217&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/8669884271411580217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/8669884271411580217'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/03/spring-mvc-walkthroughs.html' title='Spring MVC Walkthroughs'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-7133637785422356935</id><published>2010-03-06T16:07:00.002-06:00</published><updated>2010-03-06T16:09:46.320-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='configuration'/><title type='text'>Configuration Is Not Inherently Evil</title><content type='html'>&lt;p&gt;Personally, it's not that I don't like configuration or xml files. It's more that I don't like &lt;em&gt;complicated&lt;/em&gt; configuration.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-7133637785422356935?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/7133637785422356935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=7133637785422356935&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/7133637785422356935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/7133637785422356935'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/03/configuration-is-not-inherently-evil.html' title='Configuration Is Not Inherently Evil'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-546036302771755219</id><published>2010-03-06T14:16:00.008-06:00</published><updated>2010-03-06T14:22:54.748-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jee'/><category scheme='http://www.blogger.com/atom/ns#' term='webxml'/><title type='text'>Web Xml Order</title><content type='html'>&lt;p&gt;I &lt;em&gt;sort-a-knew&lt;/em&gt; &lt;a href="http://wiki.metawerx.net/wiki/Web.xml.FilterMapping"&gt;this&lt;/a&gt; but nice to see it down on paper.&lt;/p&gt;
&lt;p&gt;&lt;blockquote&gt;Despite some developers stating that the order of elements in web.xml must follow an exact order, for the most part this is incorrect. However, some elements must be defined before others. Filter and filter-mapping are one such example &amp;hellip;&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;I think this used to be the case pre the 2.x spec maybe?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-546036302771755219?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/546036302771755219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=546036302771755219&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/546036302771755219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/546036302771755219'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/03/web-xml-order.html' title='Web Xml Order'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-5256462581027526543</id><published>2010-03-06T12:46:00.007-06:00</published><updated>2010-07-23T21:34:07.130-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exceptions'/><title type='text'>Exception Handling for Exceptional Handling</title><content type='html'>&lt;p&gt;Found an interesting writeup on &lt;a href="http://www.objectsource.com/j2eechapters/Ch18-Exception_Handling.htm"&gt;Exception Handling&lt;/a&gt;. I agree with their assertion
&lt;blockquote&gt;Exceptions should be thrown only when there is no meaningful way of handling the situation. If these situations (conditions) can be handled programmatically in a meaningful manner, then throwing exceptions should be avoided. For instance if it is possible to handle the problem of withdrawal amount exceeding the balance in some other way, it has to be chosen over throwing an application exception.&lt;/blockquote&gt;
&lt;p&gt;but am particularly confused with one of their &lt;em&gt;contradictory&lt;/em&gt; examples elsewhere in the expose:&lt;/p&gt;
&lt;blockquote&gt;A rule of thumb is to model application exceptions as checked exceptions and system exceptions as unchecked exceptions. The code below is an example of application exception.
 
&lt;pre&gt;&lt;code&gt;    if (withDrawalAmt &gt; accountBalance)
    {
        throw new NotEnoughBalanceException(
        “Your account does not have enough balance”);
    }&lt;/code&gt;&lt;/pre&gt;
 
When the account does not have enough balance for requested withdrawal amount, the user gets a NotEnoughBalanceException. The user can decide to withdraw lesser amount. Notice that the application exception is not logged. In case of the application exceptions, the developer explicitly throws them in the code and the intent is very clear. &lt;/blockquote&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-5256462581027526543?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/5256462581027526543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=5256462581027526543&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/5256462581027526543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/5256462581027526543'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/03/exception-handling-for-exceptional.html' title='Exception Handling for Exceptional Handling'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-4207376821312302955</id><published>2010-03-05T17:08:00.002-06:00</published><updated>2010-03-05T17:11:47.960-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='versioning'/><title type='text'>A Versioning Strategy</title><content type='html'>&lt;p&gt;&lt;a href="http://wiki.fasterxml.com/JacksonDownload"&gt;Jackson versioning&lt;/a&gt; follows guidelines similar to [the] ones Eclipse project uses, so that:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Major version upgrade indicates incompatible changes.&lt;ul&gt;
&lt;li&gt;You MUST recompile (and re-test) your application or service when upgrading to a new major version&lt;/li&gt;
&lt;li&gt;Major version upgrades occur rarely&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Minor version upgrade indicates added functionality, but without removing existing functionality&lt;ul&gt;
&lt;li&gt;It is possible that observed behavior changes, but this should usually not cause compatibility problems&lt;/li&gt;
&lt;li&gt;Changes are binary compatible so it is possible -- although not recommended -- to just upgrade jar. Instead, you should recompile application, and re-test code that uses Jackson&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Patch version upgrades are strictly for bug fixes, and no new functionality is added&lt;ul&gt;
&lt;li&gt;Only changes to observed behavior is to fix broken behavior&lt;/li&gt;
&lt;li&gt;Upgrade by swapping jars should work without problems&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-4207376821312302955?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/4207376821312302955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=4207376821312302955&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4207376821312302955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4207376821312302955'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/03/versioning-strategy.html' title='A Versioning Strategy'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-4061639917145310563</id><published>2010-03-04T22:02:00.008-06:00</published><updated>2010-03-04T22:12:03.121-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jee'/><title type='text'>Basic JEE Web Config</title><content type='html'>&lt;p&gt;web.xml (2.4):
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
    version="2.4"&amp;gt;
   &amp;hellip;
&amp;lt;/web-app&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-4061639917145310563?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/4061639917145310563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=4061639917145310563&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4061639917145310563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4061639917145310563'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/03/basic-jee-web-config.html' title='Basic JEE Web Config'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-6415506652764024891</id><published>2010-02-27T21:50:00.004-06:00</published><updated>2010-02-27T21:53:28.470-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pmd'/><category scheme='http://www.blogger.com/atom/ns#' term='findbugs'/><category scheme='http://www.blogger.com/atom/ns#' term='checkstyle'/><title type='text'>FindBugs vs PMD</title><content type='html'>&lt;p&gt;&lt;a href="http://sonar.codehaus.org/what-makes-checkstyle-pmd-findbugs-and-macker-complementary/"&gt;This post&lt;/a&gt; nicely distinguishes &lt;a href="http://findbugs.sourceforge.net/"&gt;FindBugs&lt;/a&gt;, &lt;a href="http://pmd.sourceforge.net/"&gt;PMD&lt;/a&gt; and a few other static code checkers.&lt;/p&gt;

&lt;p&gt;&lt;blockquote&gt;Each of them is mainly targeting a certain type of coding rules : conventions (Checkstyle), bad practices (PMD) and potential bugs (FindBugs).&lt;/blockquote&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-6415506652764024891?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/6415506652764024891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=6415506652764024891&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/6415506652764024891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/6415506652764024891'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/02/findbugs-vs-pmd.html' title='FindBugs vs PMD'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-4192587769355341144</id><published>2010-02-27T13:02:00.002-06:00</published><updated>2010-02-27T13:05:23.509-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA_HOME'/><category scheme='http://www.blogger.com/atom/ns#' term='mac'/><title type='text'>Where Is JAVA_HOME On A Mac?</title><content type='html'>&lt;p&gt;The Java homes on Macs are in the &lt;a href="http://netbeans.org/kb/61/java/javafx-jdk6-on-32-bit-mac.html"&gt;/System/Library/Frameworks/JavaVM.framework&lt;/a&gt; directory.&lt;/p&gt;

&lt;p&gt;Or, if you prefer, try &lt;a href="http://www.mehtanirav.com/2008/09/02/setting-java_home-on-mac-os-x-105"&gt;~/Libary/Java/Home&lt;/a&gt; or reading &lt;a href="http://www.oreillynet.com/mac/blog/2001/04/mac_os_x_java_wheres_my_java_h.html"&gt;this&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-4192587769355341144?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/4192587769355341144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=4192587769355341144&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4192587769355341144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4192587769355341144'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/02/where-is-javahome-on-mac.html' title='Where Is JAVA_HOME On A Mac?'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-1549561501768171757</id><published>2010-02-27T12:09:00.007-06:00</published><updated>2010-02-27T12:16:38.943-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hsqldb'/><title type='text'>HSQLDB Settings</title><content type='html'>&lt;p&gt;The home page docs aren't exactly the latest (1.8.x) so I had to &lt;a href="http://sourceforge.net/projects/hsqldb/files/"&gt;download the project&lt;/a&gt; to find the new argument style.&lt;/p&gt;

&lt;p&gt;Now, to get help, try:
&lt;pre&gt;&lt;code&gt;java -cp ${CLASSPATH} org.hsqldb.Server -?&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;And here's a sample startup script:
&lt;pre&gt;&lt;code&gt;!/bin/sh

REPO=$HOME/.m2/repository
CP=$REPO/org/hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.jar

java -cp $CP org.hsqldb.Server \
        -database.0 file:agenda.hsqldb \
        -dbname agenda&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-1549561501768171757?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/1549561501768171757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=1549561501768171757&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/1549561501768171757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/1549561501768171757'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/02/hsqldb-settings.html' title='HSQLDB Settings'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-116753419288157628</id><published>2010-02-27T09:38:00.005-06:00</published><updated>2010-02-27T09:43:55.418-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><category scheme='http://www.blogger.com/atom/ns#' term='jdk'/><title type='text'>Maven JDK Settings</title><content type='html'>&lt;p&gt;This is always such a pain to remember so I'm &lt;a href="http://twit88.com/blog/2008/03/09/maven-compile-your-application-to-be-14-15-or-16-compatible/"&gt;shamelessly copying&lt;/a&gt; it here for future reference.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;2.0.2&amp;lt;/version&amp;gt;
    &amp;lt;configuration&amp;gt;
        &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;
        &amp;lt;target&amp;gt;jsr14&amp;lt;/target&amp;gt;
    &amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;

&amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;2.0.2&amp;lt;/version&amp;gt;
    &amp;lt;configuration&amp;gt;
        &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;
        &amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;
    &amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;

&amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;2.0.2&amp;lt;/version&amp;gt;
    &amp;lt;configuration&amp;gt;
        &amp;lt;source&amp;gt;1.6&amp;lt;/source&amp;gt;
        &amp;lt;target&amp;gt;1.6&amp;lt;/target&amp;gt;
    &amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-116753419288157628?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/116753419288157628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=116753419288157628&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/116753419288157628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/116753419288157628'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/02/maven-jdk-settings.html' title='Maven JDK Settings'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-6677336648140123257</id><published>2010-02-27T08:46:00.004-06:00</published><updated>2010-02-27T08:50:03.979-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pragmatic-programmer'/><category scheme='http://www.blogger.com/atom/ns#' term='stripes'/><title type='text'>How Much Fun Can Web Development Be?</title><content type='html'>&lt;p&gt;&lt;blockquote&gt;Tired of complicated Java web frameworks that just get in your way?&lt;/blockquote&gt;&lt;/p&gt;

&lt;a href="http://www.pragprog.com/titles/fdstr/stripes"&gt;Yes&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-6677336648140123257?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/6677336648140123257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=6677336648140123257&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/6677336648140123257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/6677336648140123257'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/02/how-much-fun-can-web-development-be.html' title='How Much Fun Can Web Development Be?'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-3697099960931247254</id><published>2010-02-01T10:38:00.005-06:00</published><updated>2010-02-01T10:53:30.455-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='percentile'/><title type='text'>Calcuating Percentiles</title><content type='html'>&lt;p&gt;A simple proof-of-concept to better understand how to calculate percentiles.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public class PercentileTest
{
    public static void main(final String[] args)
    {
        final int[] scores = { 40, 50, 50, 66, 67, 67, 68, 69, 73, 75, 79, 79,
                81, 82, 82, 88, 89, 93, 93, 93, 99, 100
        };

        int outerCounter = 0;
        int repeatingCounter = 0;
        int lastScore = -1;

        for (final int s : scores) {
            if (s != lastScore) {
                outerCounter = outerCounter + 1 + repeatingCounter;
                repeatingCounter = 0;
            } else {
                repeatingCounter = repeatingCounter + 1;
            }
            final float percentile = (float) outerCounter / scores.length * 100;
            System.out.println("Score: " + s + "\tPercentile: " + percentile);
            lastScore = s;
        }
    }
}&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-3697099960931247254?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/3697099960931247254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=3697099960931247254&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3697099960931247254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3697099960931247254'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/02/calcuating-percentiles.html' title='Calcuating Percentiles'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-7759768879371930506</id><published>2010-01-23T11:17:00.016-06:00</published><updated>2010-02-27T08:53:12.047-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='style'/><title type='text'>Method Name Guidelines</title><content type='html'>&lt;p&gt;As a general rule, do you prefer:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Account findAccount(String telephoneNumber);
Account findAccount(String company, String division, String accountNumber);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Account findAccountByTelephoneNumber(String telephoneNumber);
Account findAccountByCompanyAndDivisionAndAccountNumber(String company, 
                                                        String division, 
                                                        String accountNumber);&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-7759768879371930506?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/7759768879371930506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=7759768879371930506&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/7759768879371930506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/7759768879371930506'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/01/method-name-guidelines.html' title='Method Name Guidelines'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-3800564919572530978</id><published>2010-01-22T07:39:00.002-06:00</published><updated>2010-01-22T07:42:57.029-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='intellisense'/><title type='text'>Take The Intellisense Challenge</title><content type='html'>Try turning off &lt;a href="http://en.wikipedia.org/wiki/IntelliSense"&gt;intellisense&lt;/a&gt; for a day (or an hour) and realize how little (or much) you actually know!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-3800564919572530978?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/3800564919572530978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=3800564919572530978&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3800564919572530978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3800564919572530978'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/01/take-intellisense-challenge.html' title='Take The Intellisense Challenge'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-8697071233412714238</id><published>2010-01-21T18:47:00.011-06:00</published><updated>2010-02-01T10:52:51.820-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='exceptions'/><title type='text'>What do these results imply?</title><content type='html'>&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;Response Time: 21801570 (iters=400000)&lt;/li&gt;
&lt;li&gt;Exception Time: 281756916 (iters=400000)&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// $Id$
package sandbox;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 * @author Luther Baker
 */
public class ExceptionalPerformance
{
    private static final int ITERATIONS = 100000;

    public static class Response
    {
        public int code;
        public String message;

        public Response(final int code, final String message)
        {
            this.code = code;
            this.message = message;
        }
    }

    public static class TestException extends RuntimeException
    {
        private static final long serialVersionUID = 1L;

        // private final Response response;

        public int code;
        public String message;

        public TestException(final int code, final String message)
        {
            // response = new Response(code, message);
            this.code = code;
            this.message = message;
        }
    }

    public static void main(final String[] args)
    {
        // prime the pump
        final List&lt;String&gt; list = new LinkedList&lt;String&gt;();
        testResponse(list);
        testException(list);

        // time it
        final long start = System.nanoTime();
        testResponse(list);
        final long stop1 = System.nanoTime();
        testException(list);
        final long stop2 = System.nanoTime();

        // calculate it
        final long resTime = stop1 - start;
        final long excTime = stop2 - stop1;

        // make sure I use the results in an way 
        // such that methods are not optimized away
        final Iterator&lt;String&gt; iter = list.iterator();
        int count = 0;
        while (iter.hasNext()) {
            iter.next();
            ++count;
        }

        // report it
        String res = resTime + " (iters=" + count + ")";
        System.out.println("Response Time:   " + res);
        String exc = excTime + " (iters=" + count + ")";
        System.out.println("Exception Time: " + exc);
    }

    public static void testResponse(final List&lt;String&gt; list)
    {
        for (int i = 0; i &lt; ITERATIONS; ++i) {
            final Response response = returnResponse(i);
            list.add(response.message);
        }
    }

    public static void testException(final List&lt;String&gt; list)
    {
        for (int i = 0; i &lt; ITERATIONS; ++i) {
            try {
                throwException(i);
            } catch (final TestException e) {
                // list.add(e.response.message);
                list.add(e.message);
            }
        }
    }

    public static Response returnResponse(final int id)
    {
        return new Response(id, "Message");
    }

    public static TestException throwException(final int id)
    {
        throw new TestException(id, "Message");
    }

}&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-8697071233412714238?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/8697071233412714238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=8697071233412714238&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/8697071233412714238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/8697071233412714238'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/01/what-do-these-results-imply.html' title='What do these results imply?'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-2048260496517994256</id><published>2010-01-20T18:51:00.001-06:00</published><updated>2010-01-21T19:14:30.203-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='exceptions'/><title type='text'>Effective Exceptions</title><content type='html'>Do you write code that throws Exceptions for expected events?

&lt;ul&gt;
  &lt;li&gt;Did you do it because it made your your code cleaner or easier to understand?&lt;/li&gt;
  &lt;li&gt;How do you think Exceptions affect performance?&lt;/li&gt;
  &lt;li&gt;Is using Exceptions in a well-defined, expected scenario, &lt;i&gt;abusing&lt;/i&gt; the Exception handling mechanism?&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-2048260496517994256?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/2048260496517994256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=2048260496517994256&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/2048260496517994256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/2048260496517994256'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/01/effective-exceptions.html' title='Effective Exceptions'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-8300111614426749845</id><published>2010-01-20T10:10:00.000-06:00</published><updated>2010-01-20T10:10:26.099-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xsd'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='guidelines'/><title type='text'>Guidelines - XSD Elements and Attributes</title><content type='html'>What are your guidelines when defining an XML data model with respect to &lt;i&gt;attributes&lt;/i&gt; and &lt;i&gt;elements&lt;/i&gt;? Elements are arguably a bit more powerful - but can you specify a case where you'd prefer attributes?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-8300111614426749845?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/8300111614426749845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=8300111614426749845&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/8300111614426749845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/8300111614426749845'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2010/01/guidelines-xsd-elements-and-attributes.html' title='Guidelines - XSD Elements and Attributes'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-7556689896469023159</id><published>2009-11-10T21:27:00.003-06:00</published><updated>2009-11-10T21:32:30.072-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ior'/><category scheme='http://www.blogger.com/atom/ns#' term='di'/><category scheme='http://www.blogger.com/atom/ns#' term='inversion-of-control'/><category scheme='http://www.blogger.com/atom/ns#' term='dependency-injection'/><title type='text'>The Case for Dependency Injection (Part 1)</title><content type='html'>&lt;p&gt;Let's begin by looking at this problem from 3 perspectives:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;assumptions&lt;/li&gt;
  &lt;li&gt;decisions&lt;/li&gt;
  &lt;li&gt;scenarios&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In any code you write you make certain &lt;strong&gt;assumptions&lt;/strong&gt;. You also make certain &lt;strong&gt;decisions&lt;/strong&gt; and your code runs in specific &lt;strong&gt;scenarios&lt;/strong&gt;. Some common &lt;em&gt;scenarios&lt;/em&gt; include localhost development, unit testing, nightly builds, manual testing, production, maintenance, integration testing, etc &amp;hellip; while some &lt;em&gt;decisions&lt;/em&gt; might include &lt;em&gt;what&lt;/em&gt; to do, &lt;em&gt;when&lt;/em&gt; and with &lt;em&gt;whom&lt;/em&gt; to do it.&lt;/p&gt;

&lt;p&gt;Let's take a look at &lt;a href="http://stackoverflow.com/questions/500637/understanding-the-need-for-a-di-framework"&gt;some code&lt;/a&gt; from the original poster's question:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    Saw saw = new HandSaw();
    SawMill sawMill = new SawMill();
    sawMill.setSaw(saw);
    sawMill.run();&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Assume that this code was compiled and running in production exactly as written. Can you construct a realistic &lt;em&gt;scenario&lt;/em&gt; where this code block would present a problem?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-7556689896469023159?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/7556689896469023159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=7556689896469023159&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/7556689896469023159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/7556689896469023159'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2009/11/case-for-dependency-injection-part-1.html' title='The Case for Dependency Injection (Part 1)'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-2054168818474671344</id><published>2009-11-10T21:05:00.005-06:00</published><updated>2010-01-20T10:05:02.462-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='guice'/><category scheme='http://www.blogger.com/atom/ns#' term='ior'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='di'/><category scheme='http://www.blogger.com/atom/ns#' term='inversion-of-control'/><category scheme='http://www.blogger.com/atom/ns#' term='dependency-injection'/><title type='text'>The Case for Dependency Injection</title><content type='html'>&lt;p&gt;I noticed the following question on &lt;a href="http://stackoverflow.com/questions/500637/understanding-the-need-for-a-di-framework"&gt;Stack Overflow&lt;/a&gt; and after about 5 minutes of drafting some ideas, I realized how complicated a good answer was.&lt;/p&gt;

&lt;p&gt;Appreciating DI and IOR takes some perspective that I can't properly convey in a few paragraphs. Applying DI takes time. A good DI strategy can really be leveraged only when the larger family of problems it addresses is properly appreciated and understood.&lt;/p&gt;

&lt;p&gt;How would you explain it?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-2054168818474671344?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/2054168818474671344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=2054168818474671344&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/2054168818474671344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/2054168818474671344'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2009/11/case-for-dependency-injection.html' title='The Case for Dependency Injection'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-4729115695249744022</id><published>2009-11-06T21:48:00.000-06:00</published><updated>2009-11-06T21:48:13.393-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='documentation'/><category scheme='http://www.blogger.com/atom/ns#' term='technical'/><category scheme='http://www.blogger.com/atom/ns#' term='github'/><title type='text'>Technical Docs</title><content type='html'>How many times have you tried to outline or take technical notes only to lose them. Maybe &lt;a href="http://github.com/effectiveprogramming"&gt;github&lt;/a&gt; can help you too! Feel free to browse the wikis and offer suggestions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-4729115695249744022?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/4729115695249744022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=4729115695249744022&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4729115695249744022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/4729115695249744022'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2009/11/technical-docs.html' title='Technical Docs'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-656611432298375629</id><published>2009-11-05T23:55:00.000-06:00</published><updated>2009-11-05T23:55:52.483-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='swf'/><category scheme='http://www.blogger.com/atom/ns#' term='charts'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Beautiful Graphs and Charts</title><content type='html'>I recently came across this very good looking &lt;a href="http://www.maani.us/xml_charts/index.php"&gt;charting library&lt;/a&gt;. Not only are the results quite professional but many of them contain several interactive elements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-656611432298375629?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/656611432298375629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=656611432298375629&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/656611432298375629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/656611432298375629'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2009/11/beautiful-graphs-and-charts.html' title='Beautiful Graphs and Charts'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-3037909272282079752</id><published>2009-11-05T23:50:00.001-06:00</published><updated>2009-11-05T23:50:58.743-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uitabbarcontroller'/><category scheme='http://www.blogger.com/atom/ns#' term='usability'/><category scheme='http://www.blogger.com/atom/ns#' term='ui'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>Justin Gets Sirius</title><content type='html'>Nice &lt;a href="http://carpeaqua.com/2009/07/12/fix-my-app-sirius-xm-satellite-radio/"&gt;article&lt;/a&gt; from Justin Williams as he redesigns the &lt;a href="http://www.siriusxm.com/oniphone/indexd.xmc?utm_source=ONIPHONEDIRECT&amp;utm_medium=Other&amp;utm_campaign=APP"&gt;Sirius iPhone App&lt;/a&gt; and contemplates a &lt;a href="http://carpeaqua.com/2009/07/08/die-you-damn-dirty-tab-bar/"&gt;UITabBarController&lt;/a&gt;-&lt;em&gt;free&lt;/em&gt; &lt;a href="http://secondgearsoftware.com/fitnesstrack/"&gt;Fitness Track 1.0&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-3037909272282079752?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/3037909272282079752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=3037909272282079752&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3037909272282079752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/3037909272282079752'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2009/11/justin-gets-sirius.html' title='Justin Gets Sirius'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5434273264113727929.post-2361799539066829419</id><published>2009-11-05T23:46:00.000-06:00</published><updated>2009-11-05T23:46:46.604-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yui'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>YUI Does Reusable CSS</title><content type='html'>+1 to the &lt;a href="http://developer.yahoo.com/yui/"&gt;YUI&lt;/a&gt; team.&lt;br /&gt;
&lt;br /&gt;
Their well-defined &lt;a href="http://developer.yahoo.com/yui/grids/"&gt;CSS&lt;/a&gt; library goes a long way to standardizing browser behavior and application structure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5434273264113727929-2361799539066829419?l=blog.effectiveprogramming.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.effectiveprogramming.com/feeds/2361799539066829419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=5434273264113727929&amp;postID=2361799539066829419&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/2361799539066829419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5434273264113727929/posts/default/2361799539066829419'/><link rel='alternate' type='text/html' href='http://blog.effectiveprogramming.com/2009/11/yui-does-reusable-css.html' title='YUI Does Reusable CSS'/><author><name>Luther Baker</name><uri>http://www.blogger.com/profile/11761643642514321111</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09971704839355361766'/></author><thr:total>0</thr:total></entry></feed>