<?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: Composition versus Inheritance</title>
	<atom:link href="http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/</link>
	<description>Software development, testing, and techie life</description>
	<lastBuildDate>Thu, 08 Mar 2012 22:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Marko Marko</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1386</link>
		<dc:creator>Marko Marko</dc:creator>
		<pubDate>Wed, 07 Sep 2011 20:14:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1386</guid>
		<description> Chad. I continue to find myself amazed at the number of devs who fail 
or willfully ignore the ease of development that can follow the adoption
 of an IoC container. Then again, their use of IoC containers would 
probably scare most people off. And of course, the biggest argument 
against is always &quot;simplicity.&quot; I found this presentation to explain why
 that idea is ridiculous:   &lt;a href=&quot;http://easycap-driver.com/&quot; rel=&quot;nofollow&quot;&gt;easycap driver&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p> Chad. I continue to find myself amazed at the number of devs who fail<br />
or willfully ignore the ease of development that can follow the adoption<br />
 of an IoC container. Then again, their use of IoC containers would<br />
probably scare most people off. And of course, the biggest argument<br />
against is always &#8220;simplicity.&#8221; I found this presentation to explain why<br />
 that idea is ridiculous:   <a href="http://easycap-driver.com/" rel="nofollow">easycap driver</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smith biwan</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1382</link>
		<dc:creator>smith biwan</dc:creator>
		<pubDate>Wed, 07 Sep 2011 04:35:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1382</guid>
		<description>Loved to read your blog.&lt;a href=&quot;http://www.goticketsnow.com/cheap-concert-tickets/Jay-Z.php&quot; rel=&quot;nofollow&quot;&gt;cheap jay-z tickets&lt;/a&gt; I would like to suggest you that traffic show most people read blogs on Mondays. &lt;a href=&quot;http://www.goticketsnow.com/cheap-concert-tickets/Kanye-West.php&quot; rel=&quot;nofollow&quot;&gt;cheap kanye west tickets&lt;/a&gt; So it should encourage blogger to write new write ups over the weekend primarily. &lt;a href=&quot;http://www.goticketsnow.com/cheap-concert-tickets/Adele.php&quot; rel=&quot;nofollow&quot;&gt;cheap adele tickets&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Loved to read your blog.<a href="http://www.goticketsnow.com/cheap-concert-tickets/Jay-Z.php" rel="nofollow">cheap jay-z tickets</a> I would like to suggest you that traffic show most people read blogs on Mondays. <a href="http://www.goticketsnow.com/cheap-concert-tickets/Kanye-West.php" rel="nofollow">cheap kanye west tickets</a> So it should encourage blogger to write new write ups over the weekend primarily. <a href="http://www.goticketsnow.com/cheap-concert-tickets/Adele.php" rel="nofollow">cheap adele tickets</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: _ryan</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1380</link>
		<dc:creator>_ryan</dc:creator>
		<pubDate>Thu, 01 Sep 2011 18:16:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1380</guid>
		<description>I know this is a year old but i felt the need to comment.
 
at Rogerio:

1)  &quot;API&quot; never refers to the public interface of a class, it refers to a well defined interface (that should be immutable) that is distributed for other people to use your class / subsystem.  This interface never, NEVER contains a constructor method, because the interface is not a class.  Hiding the details of object construction is one of the reasons you want to use an interface.  The object would be created through a Factory or Factory method, which should be designed well enough to handle changes to the object constructors.  

Your peppering of the discussion with mention of the &quot;Separated Interface&quot; enterprise pattern does nothing but add confusion.  The creation of many small, client specific interfaces (even in the same package) is not a bad thing;  it is actually encouraged by the Interface Segregation Principle of class design (google &quot;Uncle Bob SOLID&quot;).    

2) &gt;&gt;The interface of the base class (which may be abstract or not) is already a good enough abstraction.

Not if you need to add new functionality for other clients.  That is the whole point of ISP.

3) &gt;&gt;Unit tests (and I assume that &quot;mocks&quot; or &quot;fakes&quot; were meant) don&#039;t need separate interfaces at all. With Java, it&#039;s very easy....

You are making a very broad statement, and backing it up with a Java specific example.  Is providing mock implementations (in the absence of an interface) still easy in other languages like C++ / C#?

</description>
		<content:encoded><![CDATA[<p>I know this is a year old but i felt the need to comment.</p>
<p>at Rogerio:</p>
<p>1)  &#8220;API&#8221; never refers to the public interface of a class, it refers to a well defined interface (that should be immutable) that is distributed for other people to use your class / subsystem.  This interface never, NEVER contains a constructor method, because the interface is not a class.  Hiding the details of object construction is one of the reasons you want to use an interface.  The object would be created through a Factory or Factory method, which should be designed well enough to handle changes to the object constructors.  </p>
<p>Your peppering of the discussion with mention of the &#8220;Separated Interface&#8221; enterprise pattern does nothing but add confusion.  The creation of many small, client specific interfaces (even in the same package) is not a bad thing;  it is actually encouraged by the Interface Segregation Principle of class design (google &#8220;Uncle Bob SOLID&#8221;).    </p>
<p>2) &gt;&gt;The interface of the base class (which may be abstract or not) is already a good enough abstraction.</p>
<p>Not if you need to add new functionality for other clients.  That is the whole point of ISP.</p>
<p>3) &gt;&gt;Unit tests (and I assume that &#8220;mocks&#8221; or &#8220;fakes&#8221; were meant) don&#8217;t need separate interfaces at all. With Java, it&#8217;s very easy&#8230;.</p>
<p>You are making a very broad statement, and backing it up with a Java specific example.  Is providing mock implementations (in the absence of an interface) still easy in other languages like C++ / C#?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xenshun</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1377</link>
		<dc:creator>Xenshun</dc:creator>
		<pubDate>Mon, 29 Aug 2011 04:58:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1377</guid>
		<description>
  &lt;a href=&quot;http://www.assignmentmojo.co.uk/assignment-writing-service/&quot; rel=&quot;nofollow&quot;&gt;Assignment
  Writing Service&lt;/a&gt; 

I am going to save the URL and will definitely visit again. Keep it up. </description>
		<content:encoded><![CDATA[<p>  <a href="http://www.assignmentmojo.co.uk/assignment-writing-service/" rel="nofollow">Assignment<br />
  Writing Service</a> </p>
<p>I am going to save the URL and will definitely visit again. Keep it up. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ladfur</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1376</link>
		<dc:creator>Ladfur</dc:creator>
		<pubDate>Mon, 29 Aug 2011 04:37:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1376</guid>
		<description>I could tell how great you are in your field of interest. You could relate in each detail very well.
  http://www.customessayhelp.com/write-my-research-paper.html
 </description>
		<content:encoded><![CDATA[<p>I could tell how great you are in your field of interest. You could relate in each detail very well.<br />
  <a href="http://www.customessayhelp.com/write-my-research-paper.html" rel="nofollow">http://www.customessayhelp.com/write-my-research-paper.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Essay Help</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1375</link>
		<dc:creator>Essay Help</dc:creator>
		<pubDate>Fri, 26 Aug 2011 19:48:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1375</guid>
		<description>Its important to make people feel comfort near us. We are need other people in our life. We cant live alone in this life. That is why we need to make a good realtion to all the people around us.
</description>
		<content:encoded><![CDATA[<p>Its important to make people feel comfort near us. We are need other people in our life. We cant live alone in this life. That is why we need to make a good realtion to all the people around us.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chadmyers</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1150</link>
		<dc:creator>chadmyers</dc:creator>
		<pubDate>Mon, 08 Mar 2010 17:33:26 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1150</guid>
		<description>@Rogério: 

When I read that article, I saw it as supporting my case and refuting yours.

What Fowler wanted to do was basically extract an interface on Vector, for example, because Vector didn&#039;t have an explicit interface.  The Java library was designed incorrectly here and only allowed inheritance, not composition.  You could only derive from Vector and change only the virtual things (which is probably most), but you still get some implementation whether you want it or not.

If the Java library designers had created IVector and created a default Vector, but only ever coupled to the abstraction (IVector), Fowler never would have had problems with this.

This problem is systemic in the .NET BCL as well.  </description>
		<content:encoded><![CDATA[<p>@Rogério: </p>
<p>When I read that article, I saw it as supporting my case and refuting yours.</p>
<p>What Fowler wanted to do was basically extract an interface on Vector, for example, because Vector didn&#8217;t have an explicit interface.  The Java library was designed incorrectly here and only allowed inheritance, not composition.  You could only derive from Vector and change only the virtual things (which is probably most), but you still get some implementation whether you want it or not.</p>
<p>If the Java library designers had created IVector and created a default Vector, but only ever coupled to the abstraction (IVector), Fowler never would have had problems with this.</p>
<p>This problem is systemic in the .NET BCL as well.  </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rog&#233;rio</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1149</link>
		<dc:creator>Rog&#233;rio</dc:creator>
		<pubDate>Mon, 08 Mar 2010 16:00:10 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1149</guid>
		<description>An excellent article which should clear up things:

http://martinfowler.com/bliki/ImplicitInterfaceImplementation.html</description>
		<content:encoded><![CDATA[<p>An excellent article which should clear up things:</p>
<p><a href="http://martinfowler.com/bliki/ImplicitInterfaceImplementation.html" rel="nofollow">http://martinfowler.com/bliki/ImplicitInterfaceImplementation.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rog&#233;rio</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1148</link>
		<dc:creator>Rog&#233;rio</dc:creator>
		<pubDate>Fri, 05 Mar 2010 00:26:03 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1148</guid>
		<description>To the ones disagreeing with what I said: it&#039;s ok to disagree, but bear in mind this is a technical discussion. If you don&#039;t have any arguments to support your position, why are you even posting here?

I will give more evidence to support my arguments. First, see this article by one of the GoF authors: http://www.artima.com/lejava/articles/designprinciples.html

Note the parts saying &quot;This principle tells us that depending on an interface is *often* beneficial.&quot;, and the other one saying &quot;Fortunately, with today&#039;s refactoring support you no longer have to come up with an interface up front. You can distill an interface from a concrete class once you have the full insights into a problem. The intended interface is just one &#039;extract interface&#039; refactoring away.&quot; And of course, he was talking about *separate* interfaces, not &quot;interface&quot; in the general sense. Again, it&#039;s perfectly fine to create classes which only have implicit interfaces, and this does not violate the principle. The GoF authors never intended to encourage generalized creation of separate interfaces, but only in situations where up-front design is justified to achieve *reusable* code.</description>
		<content:encoded><![CDATA[<p>To the ones disagreeing with what I said: it&#8217;s ok to disagree, but bear in mind this is a technical discussion. If you don&#8217;t have any arguments to support your position, why are you even posting here?</p>
<p>I will give more evidence to support my arguments. First, see this article by one of the GoF authors: <a href="http://www.artima.com/lejava/articles/designprinciples.html" rel="nofollow">http://www.artima.com/lejava/articles/designprinciples.html</a></p>
<p>Note the parts saying &#8220;This principle tells us that depending on an interface is *often* beneficial.&#8221;, and the other one saying &#8220;Fortunately, with today&#8217;s refactoring support you no longer have to come up with an interface up front. You can distill an interface from a concrete class once you have the full insights into a problem. The intended interface is just one &#8216;extract interface&#8217; refactoring away.&#8221; And of course, he was talking about *separate* interfaces, not &#8220;interface&#8221; in the general sense. Again, it&#8217;s perfectly fine to create classes which only have implicit interfaces, and this does not violate the principle. The GoF authors never intended to encourage generalized creation of separate interfaces, but only in situations where up-front design is justified to achieve *reusable* code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frustrated at Rog&#233;rio</title>
		<link>http://lostechies.com/chadmyers/2010/02/13/composition-versus-inheritance/#comment-1147</link>
		<dc:creator>Frustrated at Rog&#233;rio</dc:creator>
		<pubDate>Thu, 04 Mar 2010 04:46:38 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chad_myers/archive/2010/02/12/composition-versus-inheritance.aspx#comment-1147</guid>
		<description>@Rogério - I disagree and I think *you* have misunderstood. That is all I have to say.</description>
		<content:encoded><![CDATA[<p>@Rogério &#8211; I disagree and I think *you* have misunderstood. That is all I have to say.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
