<?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: When in Doubt, Create an Interface</title>
	<atom:link href="http://coliveira.net/software/when-in-doubt-create-an-interface/feed/" rel="self" type="application/rss+xml" />
	<link>http://coliveira.net/software/when-in-doubt-create-an-interface/</link>
	<description>by Carlos Oliveira</description>
	<lastBuildDate>Tue, 15 May 2012 01:46:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Ondra "Satai" Nekola</title>
		<link>http://coliveira.net/software/when-in-doubt-create-an-interface/comment-page-1/#comment-135</link>
		<dc:creator>Ondra "Satai" Nekola</dc:creator>
		<pubDate>Fri, 29 May 2009 14:54:13 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=258#comment-135</guid>
		<description>@colivera: you don&#039;t need to be tight to the implementation, abstract class can provide just abstract methods. But anytime later, you would like to add a method, you can provide it (of course with a basic implementation) and clients can provide their own implementation later.
Providing both interface and abstract class may be helpful in some scenarios (probably most notably, when you sometimes need some form of &quot;multiple inheritance&quot;), but it can not remove the main problem - you can not add methods into the interface, that can be implemented by your clients.

And I definitely agree with you, that this theme has no right solution, that fits every situation. Such a rule would be great, but now we need to use our brains and experience to decide every time.

(Btw: this problem affects source code level compatibility more than binary compatibility, at least at Java platform.)</description>
		<content:encoded><![CDATA[<p>@colivera: you don&#8217;t need to be tight to the implementation, abstract class can provide just abstract methods. But anytime later, you would like to add a method, you can provide it (of course with a basic implementation) and clients can provide their own implementation later.<br />
Providing both interface and abstract class may be helpful in some scenarios (probably most notably, when you sometimes need some form of &#8220;multiple inheritance&#8221;), but it can not remove the main problem &#8211; you can not add methods into the interface, that can be implemented by your clients.</p>
<p>And I definitely agree with you, that this theme has no right solution, that fits every situation. Such a rule would be great, but now we need to use our brains and experience to decide every time.</p>
<p>(Btw: this problem affects source code level compatibility more than binary compatibility, at least at Java platform.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: coliveira</title>
		<link>http://coliveira.net/software/when-in-doubt-create-an-interface/comment-page-1/#comment-134</link>
		<dc:creator>coliveira</dc:creator>
		<pubDate>Fri, 29 May 2009 14:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=258#comment-134</guid>
		<description>@Satai: hi, your points are very relevant. Of course there are some disadvantages in publishing interfaces, but this has to do with maintaining binary compatibility across libraries. It is something that you cannot get completely rid of when using statically typed languages.

Using abstract classes also has a lot of disadvantages, the biggest one being that you are tied to that implementation. Also everyone needs to inherit from that class, which limits usability. One common solution is to provide an interface AND an abstract class. You have to study each case to see what is more suitable.</description>
		<content:encoded><![CDATA[<p>@Satai: hi, your points are very relevant. Of course there are some disadvantages in publishing interfaces, but this has to do with maintaining binary compatibility across libraries. It is something that you cannot get completely rid of when using statically typed languages.</p>
<p>Using abstract classes also has a lot of disadvantages, the biggest one being that you are tied to that implementation. Also everyone needs to inherit from that class, which limits usability. One common solution is to provide an interface AND an abstract class. You have to study each case to see what is more suitable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Satai</title>
		<link>http://coliveira.net/software/when-in-doubt-create-an-interface/comment-page-1/#comment-133</link>
		<dc:creator>Satai</dc:creator>
		<pubDate>Fri, 29 May 2009 13:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=258#comment-133</guid>
		<description>Please, don&#039;t use/publish interfaces in your APIs! ;)
Interfaces are OK, when you use them after a very serious consideration. But publishing an interface is a common trouble, you are not allowed to change it anymore. You can not remove methods - your clients can call it. You can&#039;t add methods - your clients may implement the interface and this would broke their implementation. And (of course) you may not change signatures for the same reasons.
Abstract classes are much more suitable solution in majority of situations.</description>
		<content:encoded><![CDATA[<p>Please, don&#8217;t use/publish interfaces in your APIs! ;)<br />
Interfaces are OK, when you use them after a very serious consideration. But publishing an interface is a common trouble, you are not allowed to change it anymore. You can not remove methods &#8211; your clients can call it. You can&#8217;t add methods &#8211; your clients may implement the interface and this would broke their implementation. And (of course) you may not change signatures for the same reasons.<br />
Abstract classes are much more suitable solution in majority of situations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sud</title>
		<link>http://coliveira.net/software/when-in-doubt-create-an-interface/comment-page-1/#comment-106</link>
		<dc:creator>sud</dc:creator>
		<pubDate>Wed, 20 May 2009 03:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://coliveira.net/?p=258#comment-106</guid>
		<description>The Interface Segregation Principle from SOLID priciples provides a useful guideline on creating lean and clean interfaces that resist bloat.</description>
		<content:encoded><![CDATA[<p>The Interface Segregation Principle from SOLID priciples provides a useful guideline on creating lean and clean interfaces that resist bloat.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

