<?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"
	>
<channel>
	<title>Comments on: Template Pattern: Friend or Foe?</title>
	<atom:link href="http://www.englishteeth.co.uk/2008/04/29/template-pattern-friend-or-foe/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.englishteeth.co.uk/2008/04/29/template-pattern-friend-or-foe/</link>
	<description>... the weblog of Ian "English Teeth" Robinson</description>
	<pubDate>Fri, 21 Nov 2008 08:05:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Ian</title>
		<link>http://www.englishteeth.co.uk/2008/04/29/template-pattern-friend-or-foe/#comment-42</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Wed, 30 Apr 2008 15:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.englishteeth.co.uk/?p=48#comment-42</guid>
		<description>Unfortunately, I have also witnessed the results of poor evolution...

...and I'd also go for composition over inheritance. 

Using the template pattern is not an approach I would necessarily &lt;em&gt;design in&lt;/em&gt;. As you stated in your post, by using the template pattern you are essentially building a mini-framework and that isn't something to be undertaken lightly.

Nevertheless, of late I have found myself tackling existing code using existing frameworks that do involve concrete inheritance. Some judicious use of the template pattern, I feel, has helped clean things up, introduce some degree of control and kill a few bugs.

Thanks for the comment (and giving me something to blog about)!</description>
		<content:encoded><![CDATA[<p>Unfortunately, I have also witnessed the results of poor evolution&#8230;</p>
<p>&#8230;and I&#8217;d also go for composition over inheritance. </p>
<p>Using the template pattern is not an approach I would necessarily <em>design in</em>. As you stated in your post, by using the template pattern you are essentially building a mini-framework and that isn&#8217;t something to be undertaken lightly.</p>
<p>Nevertheless, of late I have found myself tackling existing code using existing frameworks that do involve concrete inheritance. Some judicious use of the template pattern, I feel, has helped clean things up, introduce some degree of control and kill a few bugs.</p>
<p>Thanks for the comment (and giving me something to blog about)!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Miller</title>
		<link>http://www.englishteeth.co.uk/2008/04/29/template-pattern-friend-or-foe/#comment-41</link>
		<dc:creator>Alex Miller</dc:creator>
		<pubDate>Wed, 30 Apr 2008 13:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.englishteeth.co.uk/?p=48#comment-41</guid>
		<description>Yes, I think your example shows an improvement.  However, my experience has been that classes (and particularly APIs) built on the template method evolve poorly over time.  At the beginning, they work great.  But over time you keep coming up with new refinements in the templated code and often you start to insert layers of multiple abstract classes, each with their own sets of template methods.  I've been down this road more than once and it quickly becomes a nightmare.

In general, I find that using composition over inheritance can be just as clear intent-wise plus it evolves in a linear way allowing you to mix and match the functionality you need.  

Unfortunately this is a difficult argument to make without showing a whole lot of code or having lived through it yourself.</description>
		<content:encoded><![CDATA[<p>Yes, I think your example shows an improvement.  However, my experience has been that classes (and particularly APIs) built on the template method evolve poorly over time.  At the beginning, they work great.  But over time you keep coming up with new refinements in the templated code and often you start to insert layers of multiple abstract classes, each with their own sets of template methods.  I&#8217;ve been down this road more than once and it quickly becomes a nightmare.</p>
<p>In general, I find that using composition over inheritance can be just as clear intent-wise plus it evolves in a linear way allowing you to mix and match the functionality you need.  </p>
<p>Unfortunately this is a difficult argument to make without showing a whole lot of code or having lived through it yourself.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
