<?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: Interfaces and Implementations</title>
	<atom:link href="http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/</link>
	<description>Technology and Geek Stuff by Eric Burke</description>
	<lastBuildDate>Thu, 04 Nov 2010 22:37:00 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mP</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-51215</link>
		<dc:creator>mP</dc:creator>
		<pubDate>Sun, 20 Jun 2010 02:42:48 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-51215</guid>
		<description>Ultimately the classname should be a short descriptive thing, appending &quot;Impl&quot; or using &quot;I&quot; as a prefix for an interface does not help. After all an interface is a description of something, prefixing with &quot;I&quot; or addng &quot;Impl&quot; does not say how we are implementing that interface.

Most of time one (should) works with interfaces, so it makes sense to have a simple name that describes the &quot;what&quot; and not the &quot;how&quot;. A prefix like &quot;I&quot; is just ugly, and becomes silly as good code will have a lot of interfaces. Using a compound naming system like implementation detail + interface name is descriptive. ArrayList and LinkList are perfect examples of this, each describing &quot;what&quot; type of &quot;List&#039; they are.</description>
		<content:encoded><![CDATA[<p>Ultimately the classname should be a short descriptive thing, appending &#8220;Impl&#8221; or using &#8220;I&#8221; as a prefix for an interface does not help. After all an interface is a description of something, prefixing with &#8220;I&#8221; or addng &#8220;Impl&#8221; does not say how we are implementing that interface.</p>
<p>Most of time one (should) works with interfaces, so it makes sense to have a simple name that describes the &#8220;what&#8221; and not the &#8220;how&#8221;. A prefix like &#8220;I&#8221; is just ugly, and becomes silly as good code will have a lot of interfaces. Using a compound naming system like implementation detail + interface name is descriptive. ArrayList and LinkList are perfect examples of this, each describing &#8220;what&#8221; type of &#8220;List&#8217; they are.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kiril</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-51188</link>
		<dc:creator>Kiril</dc:creator>
		<pubDate>Fri, 07 May 2010 08:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-51188</guid>
		<description>The Suffix like Impl or Default does not say anything. I also try to avoid such constructions. But some time it&#039;s very hard to imagine good prefix. When you develop application by interface a specially. In such frameworks like Spring very hard to say what prefix or suffix you should use. It is just nature of framework.</description>
		<content:encoded><![CDATA[<p>The Suffix like Impl or Default does not say anything. I also try to avoid such constructions. But some time it&#8217;s very hard to imagine good prefix. When you develop application by interface a specially. In such frameworks like Spring very hard to say what prefix or suffix you should use. It is just nature of framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill de hÓra</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-51137</link>
		<dc:creator>Bill de hÓra</dc:creator>
		<pubDate>Wed, 24 Mar 2010 22:04:29 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-51137</guid>
		<description>&quot;How is prefixing interfaces with “I” Hungarian Notation and suffixing implementations with &#039;Impl&#039; is not? The Hungarian Notation aspect is a red herring.

This red herring quacks like a straw man! I don&#039;t see Eric saying must use *Impl, must not use I*.

&quot;In short, your position is &#039;I don&#039;t care about differentiating interfaces from implementations when reading code&#039;. Matter of taste I guess, but I do code reviews several times a day and a consistent convention is a life saver.

I&#039;m guessing you don’t often review code that is not yours?
&quot;&quot;&quot;

This is not a good enough reason to introduce noise anymore. I spend most time reading other people&#039;s code these days and the answer was simple - highlight interfaces in your Java IDE settings. You&#039;ll see concrete class easily, especially where they&#039;re being new&#039;d or passed in as arguments. If you&#039;re reviewing patches, then apply them so they show up instead of just eyeballing changesets. 

I guess the meta argument that interfaces are hobbled compared to constructs like Scala traits is for another day ;)</description>
		<content:encoded><![CDATA[<p>&#8220;How is prefixing interfaces with “I” Hungarian Notation and suffixing implementations with &#8216;Impl&#8217; is not? The Hungarian Notation aspect is a red herring.</p>
<p>This red herring quacks like a straw man! I don&#8217;t see Eric saying must use *Impl, must not use I*.</p>
<p>&#8220;In short, your position is &#8216;I don&#8217;t care about differentiating interfaces from implementations when reading code&#8217;. Matter of taste I guess, but I do code reviews several times a day and a consistent convention is a life saver.</p>
<p>I&#8217;m guessing you don’t often review code that is not yours?<br />
&#8220;&#8221;"</p>
<p>This is not a good enough reason to introduce noise anymore. I spend most time reading other people&#8217;s code these days and the answer was simple &#8211; highlight interfaces in your Java IDE settings. You&#8217;ll see concrete class easily, especially where they&#8217;re being new&#8217;d or passed in as arguments. If you&#8217;re reviewing patches, then apply them so they show up instead of just eyeballing changesets. </p>
<p>I guess the meta argument that interfaces are hobbled compared to constructs like Scala traits is for another day <img src='http://stuffthathappens.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tasos Zervos</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50988</link>
		<dc:creator>Tasos Zervos</dc:creator>
		<pubDate>Tue, 23 Feb 2010 10:41:23 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50988</guid>
		<description>In fact, Bob Martin has a whole chapter on naming in his newest book: Clean Code.</description>
		<content:encoded><![CDATA[<p>In fact, Bob Martin has a whole chapter on naming in his newest book: Clean Code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Serodio</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50948</link>
		<dc:creator>Daniel Serodio</dc:creator>
		<pubDate>Fri, 19 Feb 2010 18:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50948</guid>
		<description>No &quot;I&quot; in interfaces. Bob Martin explains in &quot;Agile Software Development, Principles, Patterns, and Practices&quot; that prefixing &quot;I&quot; leads to non-reusable interfaces, because the interfaces should be closer to its users (clients) then its providers (implementations).

Consider a Lamp class with switchOn() and switchOff() methods. When you extract an interface, should you call it &quot;ILamp&quot; ? No, you should call it &quot;Switchable&quot; !</description>
		<content:encoded><![CDATA[<p>No &#8220;I&#8221; in interfaces. Bob Martin explains in &#8220;Agile Software Development, Principles, Patterns, and Practices&#8221; that prefixing &#8220;I&#8221; leads to non-reusable interfaces, because the interfaces should be closer to its users (clients) then its providers (implementations).</p>
<p>Consider a Lamp class with switchOn() and switchOff() methods. When you extract an interface, should you call it &#8220;ILamp&#8221; ? No, you should call it &#8220;Switchable&#8221; !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Gilstrap</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50942</link>
		<dc:creator>Brian Gilstrap</dc:creator>
		<pubDate>Wed, 17 Feb 2010 21:24:35 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50942</guid>
		<description>My thinking exactly.</description>
		<content:encoded><![CDATA[<p>My thinking exactly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy Strelitz</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50941</link>
		<dc:creator>Guy Strelitz</dc:creator>
		<pubDate>Wed, 17 Feb 2010 15:02:04 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50941</guid>
		<description>Sebastian you&#039;ve probably not used a framework like Spring, in which the convention is to code to an interface which you connect to a specific implementation (which may have eg alternate vendors ) in your app&#039;s configuration. I think this underlies Eric&#039;s points 1 and 3 above.

On the other hand, Eric I wonder if your notes about Hungarian notation might just be stylistic preference. I&#039;ve used it a lot in the c/c++ world and it&#039;s a really useful convention, only partially obviated by modern IDEs.</description>
		<content:encoded><![CDATA[<p>Sebastian you&#8217;ve probably not used a framework like Spring, in which the convention is to code to an interface which you connect to a specific implementation (which may have eg alternate vendors ) in your app&#8217;s configuration. I think this underlies Eric&#8217;s points 1 and 3 above.</p>
<p>On the other hand, Eric I wonder if your notes about Hungarian notation might just be stylistic preference. I&#8217;ve used it a lot in the c/c++ world and it&#8217;s a really useful convention, only partially obviated by modern IDEs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Wilson</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50922</link>
		<dc:creator>Jesse Wilson</dc:creator>
		<pubDate>Wed, 17 Feb 2010 01:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50922</guid>
		<description>Agreed!</description>
		<content:encoded><![CDATA[<p>Agreed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50917</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Tue, 16 Feb 2010 23:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50917</guid>
		<description>I miss option 3 where there is no &quot;Impl&quot; and no &quot;IWhatever&quot;. I am sure you will not need the whole dog in the client. Maybe only a &quot;Pet&quot; you can feed or any other role .... Reminds me of the  &quot;interface segregation principle&quot;:
http://www.objectmentor.com/resources/articles/isp.pdf</description>
		<content:encoded><![CDATA[<p>I miss option 3 where there is no &#8220;Impl&#8221; and no &#8220;IWhatever&#8221;. I am sure you will not need the whole dog in the client. Maybe only a &#8220;Pet&#8221; you can feed or any other role &#8230;. Reminds me of the  &#8220;interface segregation principle&#8221;:<br />
<a href="http://www.objectmentor.com/resources/articles/isp.pdf" rel="nofollow">http://www.objectmentor.com/resources/articles/isp.pdf</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wcoenen</title>
		<link>http://stuffthathappens.com/blog/2010/02/16/interfaces-and-implementations/comment-page-1/#comment-50915</link>
		<dc:creator>wcoenen</dc:creator>
		<pubDate>Tue, 16 Feb 2010 23:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://stuffthathappens.com/blog/?p=1630#comment-50915</guid>
		<description>Follow the framework&#039;s lead: Option 1 for java, option 2 for .NET code. You can&#039;t avoid using framework code so going against the framework&#039;s convention would lead to a weird style mix.

I do something similar when naming members. In .NET or java I wouldn&#039;t even consider using underscores. In python I follow the PEP-8 convention which uses underscores all over the place. Again, follow the framework&#039;s lead.</description>
		<content:encoded><![CDATA[<p>Follow the framework&#8217;s lead: Option 1 for java, option 2 for .NET code. You can&#8217;t avoid using framework code so going against the framework&#8217;s convention would lead to a weird style mix.</p>
<p>I do something similar when naming members. In .NET or java I wouldn&#8217;t even consider using underscores. In python I follow the PEP-8 convention which uses underscores all over the place. Again, follow the framework&#8217;s lead.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.279 seconds -->

