<?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: Should we discard Interfaces?</title> <atom:link href="http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/feed/" rel="self" type="application/rss+xml" /><link>http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/</link> <description>Java, Project Management, Life and anything else.</description> <lastBuildDate>Tue, 22 Nov 2011 08:16:24 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Daily del.icio.us for May 18th through May 20th &#8212; Vinny Carpenter&#8217;s blog</title><link>http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/comment-page-1/#comment-73</link> <dc:creator>Daily del.icio.us for May 18th through May 20th &#8212; Vinny Carpenter&#8217;s blog</dc:creator> <pubDate>Wed, 21 May 2008 02:01:58 +0000</pubDate> <guid
isPermaLink="false">http://www.inze.be/andries/?p=29#comment-73</guid> <description>[...] Should we discard Interfaces? &#124; Learning by Experience - Is a class that only has interfaces as dependencies easier to test then classes that have implementations as dependencies? Most of us are eager to say yes, but in fact, frameworks like EasyMock enable us to mock (non final) classes. [...]</description> <content:encoded><![CDATA[<p>[...] Should we discard Interfaces? | Learning by Experience &#8211; Is a class that only has interfaces as dependencies easier to test then classes that have implementations as dependencies? Most of us are eager to say yes, but in fact, frameworks like EasyMock enable us to mock (non final) classes. [...]</p> ]]></content:encoded> </item> <item><title>By: Mark Brackett</title><link>http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/comment-page-1/#comment-72</link> <dc:creator>Mark Brackett</dc:creator> <pubDate>Mon, 19 May 2008 23:54:00 +0000</pubDate> <guid
isPermaLink="false">http://www.inze.be/andries/?p=29#comment-72</guid> <description>The fact that EasyMock, or other mocking frameworks, enable you to bypass the interface when mocking is immaterial - after all, I *could* test private functions as well. Or, use post-compilers to inject my own code.
The point of unit testing isn&#039;t only the testing - it&#039;s the seams that (if done properly) it forces you to put in to enable that testing. Interfaces are one such seam.</description> <content:encoded><![CDATA[<p>The fact that EasyMock, or other mocking frameworks, enable you to bypass the interface when mocking is immaterial &#8211; after all, I *could* test private functions as well. Or, use post-compilers to inject my own code.<br
/> The point of unit testing isn&#8217;t only the testing &#8211; it&#8217;s the seams that (if done properly) it forces you to put in to enable that testing. Interfaces are one such seam.</p> ]]></content:encoded> </item> <item><title>By: alvin</title><link>http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/comment-page-1/#comment-71</link> <dc:creator>alvin</dc:creator> <pubDate>Mon, 19 May 2008 15:27:30 +0000</pubDate> <guid
isPermaLink="false">http://www.inze.be/andries/?p=29#comment-71</guid> <description>I am of the school of thought that you touch upon here - which is really questioning the use of interfaces.
Interfaces I think have a place, especially if the software you are working on will be packaged and used by others. There are of course other instances when you interfaces are indeed called for (e.g. you will have more than one implementation, want to simulate multiple inheritance or in specific design patterns such as Observer pattern).
But when you are working on something that is specifically for yourself I am not sure it is really needed.
When I ask some people why should I use an interface they allude to the same points you mentioned.
- Ease of testing - solved by a number of test frameworks
- More than one implementation - in my programming experience the times when you will have a single implementation vastly outnumber the multiple.
Interested to hear peoples thoughts.</description> <content:encoded><![CDATA[<p>I am of the school of thought that you touch upon here &#8211; which is really questioning the use of interfaces.</p><p>Interfaces I think have a place, especially if the software you are working on will be packaged and used by others. There are of course other instances when you interfaces are indeed called for (e.g. you will have more than one implementation, want to simulate multiple inheritance or in specific design patterns such as Observer pattern).</p><p>But when you are working on something that is specifically for yourself I am not sure it is really needed.</p><p>When I ask some people why should I use an interface they allude to the same points you mentioned.<br
/> - Ease of testing &#8211; solved by a number of test frameworks<br
/> - More than one implementation &#8211; in my programming experience the times when you will have a single implementation vastly outnumber the multiple.</p><p>Interested to hear peoples thoughts.</p> ]]></content:encoded> </item> <item><title>By: Christian</title><link>http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/comment-page-1/#comment-69</link> <dc:creator>Christian</dc:creator> <pubDate>Sun, 18 May 2008 15:43:20 +0000</pubDate> <guid
isPermaLink="false">http://www.inze.be/andries/?p=29#comment-69</guid> <description>I think the best examples of interface use are design patterns such Command, Strategy, State or even the Proxy pattern. They are all based on interfaces for increased flexibility and reuse.
Objects can also implement many interfaces, but only extend one class (inheritance could be considered as a compile time dependency). An example of object reuse: you can divide the public methods of an object over multiple interfaces based on its use from the clients, to make it usable from different viewpoints. The same object could be used by different clients, each time with another interface. That same object would be reusable in different circumstances (but be careful for anti-patterns).</description> <content:encoded><![CDATA[<p>I think the best examples of interface use are design patterns such Command, Strategy, State or even the Proxy pattern. They are all based on interfaces for increased flexibility and reuse.<br
/> Objects can also implement many interfaces, but only extend one class (inheritance could be considered as a compile time dependency). An example of object reuse: you can divide the public methods of an object over multiple interfaces based on its use from the clients, to make it usable from different viewpoints. The same object could be used by different clients, each time with another interface. That same object would be reusable in different circumstances (but be careful for anti-patterns).</p> ]]></content:encoded> </item> <item><title>By: David</title><link>http://www.inze.be/andries/2008/05/17/should-we-discard-interfaces/comment-page-1/#comment-68</link> <dc:creator>David</dc:creator> <pubDate>Sat, 17 May 2008 21:49:06 +0000</pubDate> <guid
isPermaLink="false">http://www.inze.be/andries/?p=29#comment-68</guid> <description>Andries,
Although interfaces are useful, they should be used with care.
I personally believe interfaces offer a way to safely connect different modules and/or packages of a project. Within a package, interfaces are rarely useful, with the exception of defining a common &#039;interface&#039; of different classes.
Anyway, with the IDEs we use nowadays it is dead simple to extract an interface from a given class whenever we need it.</description> <content:encoded><![CDATA[<p>Andries,</p><p>Although interfaces are useful, they should be used with care.</p><p>I personally believe interfaces offer a way to safely connect different modules and/or packages of a project. Within a package, interfaces are rarely useful, with the exception of defining a common &#8216;interface&#8217; of different classes.</p><p>Anyway, with the IDEs we use nowadays it is dead simple to extract an interface from a given class whenever we need it.</p> ]]></content:encoded> </item> </channel> </rss>
