<?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: Live patterns: Switching to the visitor design pattern</title>
	<atom:link href="http://davidrabinowitz.com/en/2009/05/29/live-patterns-switching-to-the-visitor-design-pattern/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidrabinowitz.com/en/2009/05/29/live-patterns-switching-to-the-visitor-design-pattern/</link>
	<description></description>
	<lastBuildDate>Tue, 20 Jul 2010 11:16:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Frood</title>
		<link>http://davidrabinowitz.com/en/2009/05/29/live-patterns-switching-to-the-visitor-design-pattern/#comment-9</link>
		<dc:creator>Frood</dc:creator>
		<pubDate>Wed, 16 Jun 2010 12:33:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidrabinowitz.com/en/?p=31#comment-9</guid>
		<description>@Dimitris:
The Visitor pattern buys you a bit more than that: You can put the code into the layer it rightfully belongs to. So, the visitors concerning UI go to the UI code and the ones concerning business logic go to the business code etc. Without visitors you have to either put the code into the objects themselves, thus blurring the layers, or replicate the objects inside a layer, being cumbersome and error-prone.
Besides, in case of hierarchies you can use walkers to traverse object trees, in which visitors act as a kind of beefed-up lambda expressions. Very handy</description>
		<content:encoded><![CDATA[<p>@Dimitris:<br />
The Visitor pattern buys you a bit more than that: You can put the code into the layer it rightfully belongs to. So, the visitors concerning UI go to the UI code and the ones concerning business logic go to the business code etc. Without visitors you have to either put the code into the objects themselves, thus blurring the layers, or replicate the objects inside a layer, being cumbersome and error-prone.<br />
Besides, in case of hierarchies you can use walkers to traverse object trees, in which visitors act as a kind of beefed-up lambda expressions. Very handy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitris Andreou</title>
		<link>http://davidrabinowitz.com/en/2009/05/29/live-patterns-switching-to-the-visitor-design-pattern/#comment-8</link>
		<dc:creator>Dimitris Andreou</dc:creator>
		<pubDate>Sat, 30 May 2009 19:26:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidrabinowitz.com/en/?p=31#comment-8</guid>
		<description>Well, I don&#039;t think this is the life-saver you seem to be describing...

What visitor buys you here is merely the fact that you don&#039;t have to put an abstract method plus implementations for each distinct type-based desicion (bloating a single file), but create those implementations externally (out of the itinerary source files). I.e. you just managed to avoid putting the type-based code in the types themselves, but somewhere else. Good for you. Where would we be without patterns! :)

Btw, Scala supports the switch you describe (where the compiler notifies you of missed cases).</description>
		<content:encoded><![CDATA[<p>Well, I don&#8217;t think this is the life-saver you seem to be describing&#8230;</p>
<p>What visitor buys you here is merely the fact that you don&#8217;t have to put an abstract method plus implementations for each distinct type-based desicion (bloating a single file), but create those implementations externally (out of the itinerary source files). I.e. you just managed to avoid putting the type-based code in the types themselves, but somewhere else. Good for you. Where would we be without patterns! <img src='http://davidrabinowitz.com/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Btw, Scala supports the switch you describe (where the compiler notifies you of missed cases).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Omar</title>
		<link>http://davidrabinowitz.com/en/2009/05/29/live-patterns-switching-to-the-visitor-design-pattern/#comment-7</link>
		<dc:creator>Omar</dc:creator>
		<pubDate>Sat, 30 May 2009 16:09:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidrabinowitz.com/en/?p=31#comment-7</guid>
		<description>Ok, I think you make your point about how much cumbersome could be the code with the first two sniplets. Could you please ilustrate the visitor design patter with an example of your own? The link in the wikipedia it&#039;s ok, but don&#039;t be cheap and complete your post. ;)</description>
		<content:encoded><![CDATA[<p>Ok, I think you make your point about how much cumbersome could be the code with the first two sniplets. Could you please ilustrate the visitor design patter with an example of your own? The link in the wikipedia it&#8217;s ok, but don&#8217;t be cheap and complete your post. <img src='http://davidrabinowitz.com/en/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
