<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Static Utility Methods</title>
	<atom:link href="http://andypalmer.com/2008/05/static-utility-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://andypalmer.com/2008/05/static-utility-methods/</link>
	<description>Views on software, technology, consulting and business process</description>
	<lastBuildDate>Sun, 31 Jan 2010 16:31:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andy</title>
		<link>http://andypalmer.com/2008/05/static-utility-methods/comment-page-1/#comment-4</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Thu, 22 May 2008 16:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.andypalmer.com/blog/?p=7#comment-4</guid>
		<description>It&#039;s true with StringUtils.reverse that I would be unlikely to want to change the implementation, but I would much rather write:&lt;br/&gt;&quot;abc1234&quot;.reverse();&lt;br/&gt;than:&lt;br/&gt;StringUtils.reverse(&quot;abc1234&quot;);&lt;br/&gt;&lt;br/&gt;I think if I bumped into one of the instances I mentioned where I wanted to be able to change out the configuration at runtime, then I would use an instance wrapper around a static method...&lt;br/&gt;&lt;br/&gt;My opinions are no way set in stone, it&#039;s just that static methods make me feel icky and I&#039;m not 100% sure why :-)</description>
		<content:encoded><![CDATA[<p>It&#8217;s true with StringUtils.reverse that I would be unlikely to want to change the implementation, but I would much rather write:<br />&#8220;abc1234&#8243;.reverse();<br />than:<br />StringUtils.reverse(&#8220;abc1234&#8243;);</p>
<p>I think if I bumped into one of the instances I mentioned where I wanted to be able to change out the configuration at runtime, then I would use an instance wrapper around a static method&#8230;</p>
<p>My opinions are no way set in stone, it&#8217;s just that static methods make me feel icky and I&#8217;m not 100% sure why <img src='http://andypalmer.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mc</title>
		<link>http://andypalmer.com/2008/05/static-utility-methods/comment-page-1/#comment-3</link>
		<dc:creator>Mc</dc:creator>
		<pubDate>Wed, 21 May 2008 12:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.andypalmer.com/blog/?p=7#comment-3</guid>
		<description>You&#039;d have to involve at least 3 classes and some DI library refs to accomplish your two strategies scenario. Even then you&#039;re still coupled to one of those 3 types (interface or abstract class supertype). This complexity may be appropriate at some times, but the setup/overhead/code is overkill for a great number of common cases. Think of Math.cos or StringUtils.reverse - very unlikely that&#039;d you&#039;d want to change those, much less do the plumbing for keeping instances of those utility class available in some global context.&lt;br/&gt;&lt;br/&gt;Your post did leads me to wonder: what if static methods could be &quot;extended&quot; how might that work. I certainly haven&#039;t thought through that extensively. I&#039;m sure the java language people have, and there must be great reasons why its not possible.&lt;br/&gt;&lt;br/&gt;Maybe look at it this way: using &quot;composition,&quot; you can make whatever instantiable utility classes to wrap any existing other classes/methods you find are otherwise unsatisfactory.</description>
		<content:encoded><![CDATA[<p>You&#8217;d have to involve at least 3 classes and some DI library refs to accomplish your two strategies scenario. Even then you&#8217;re still coupled to one of those 3 types (interface or abstract class supertype). This complexity may be appropriate at some times, but the setup/overhead/code is overkill for a great number of common cases. Think of Math.cos or StringUtils.reverse &#8211; very unlikely that&#8217;d you&#8217;d want to change those, much less do the plumbing for keeping instances of those utility class available in some global context.</p>
<p>Your post did leads me to wonder: what if static methods could be &#8220;extended&#8221; how might that work. I certainly haven&#8217;t thought through that extensively. I&#8217;m sure the java language people have, and there must be great reasons why its not possible.</p>
<p>Maybe look at it this way: using &#8220;composition,&#8221; you can make whatever instantiable utility classes to wrap any existing other classes/methods you find are otherwise unsatisfactory.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
