<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Me at JavaOne: Design Patterns Reconsidered</title>
	<link>http://tech.puredanger.com/2008/05/08/dpr/</link>
	<description>Alex Miller's technical blog</description>
	<pubDate>Sun, 27 Jul 2008 01:20:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Alex</title>
		<link>http://tech.puredanger.com/2008/05/08/dpr/#comment-46946</link>
		<pubDate>Sun, 11 May 2008 02:38:06 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/05/08/dpr/#comment-46946</guid>
					<description>Hey Mark, 

Seems like a valid approach to me.  I've actually done exactly this on more than one project with the Visitor pattern and it worked quite well.  As you mention, it's nice to be able to create different kinds of validation depending on need.</description>
		<content:encoded><![CDATA[<p>Hey Mark, </p>
<p>Seems like a valid approach to me.  I&#8217;ve actually done exactly this on more than one project with the Visitor pattern and it worked quite well.  As you mention, it&#8217;s nice to be able to create different kinds of validation depending on need.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Mark</title>
		<link>http://tech.puredanger.com/2008/05/08/dpr/#comment-46794</link>
		<pubDate>Sat, 10 May 2008 13:12:51 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/05/08/dpr/#comment-46794</guid>
					<description>I'm very curious, first, as to when Visitor would be a bad choice, like you mention in your blog article above.

As for my particular case, I've created a way to serialize our data model out to plain text.  We can't use XStream or the like because I'm working with 6 year old legacy code that has  -- through its own internal architecture -- its own idioms and quirks.

When we deserialize this data back into our application, the entire data structure will be in memory but not yet committed to the database.  It's at this point that I would like to validate it with Visitor.

Our model doesn't change much, certainly not as much as the business rules do.  That's one of the intents of Visitor, to separate the ever-changing business rules from the infrequently changed model.

I'm imagining, too, we can put one validation rule in each Visitor and vary which visitors are run for our customers.  This would provide the flexibility to run one type of validation for one customer and an entirely different type of validation for another customer that has different business requirements.

I know it will work because I've prototyped it and I &lt;em&gt;think&lt;/em&gt; it would be a very elegant solution.

Would you validate a model in a different way?  Would this use of Visitor cause more harm than good, as you allude to be true for some cases?

I wish I could have seen your talk!  Maybe next year I'll get a chance to go to JavaOne.</description>
		<content:encoded><![CDATA[<p>I&#8217;m very curious, first, as to when Visitor would be a bad choice, like you mention in your blog article above.</p>
<p>As for my particular case, I&#8217;ve created a way to serialize our data model out to plain text.  We can&#8217;t use XStream or the like because I&#8217;m working with 6 year old legacy code that has  &#8212; through its own internal architecture &#8212; its own idioms and quirks.</p>
<p>When we deserialize this data back into our application, the entire data structure will be in memory but not yet committed to the database.  It&#8217;s at this point that I would like to validate it with Visitor.</p>
<p>Our model doesn&#8217;t change much, certainly not as much as the business rules do.  That&#8217;s one of the intents of Visitor, to separate the ever-changing business rules from the infrequently changed model.</p>
<p>I&#8217;m imagining, too, we can put one validation rule in each Visitor and vary which visitors are run for our customers.  This would provide the flexibility to run one type of validation for one customer and an entirely different type of validation for another customer that has different business requirements.</p>
<p>I know it will work because I&#8217;ve prototyped it and I <em>think</em> it would be a very elegant solution.</p>
<p>Would you validate a model in a different way?  Would this use of Visitor cause more harm than good, as you allude to be true for some cases?</p>
<p>I wish I could have seen your talk!  Maybe next year I&#8217;ll get a chance to go to JavaOne.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex</title>
		<link>http://tech.puredanger.com/2008/05/08/dpr/#comment-46732</link>
		<pubDate>Sat, 10 May 2008 05:42:57 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/05/08/dpr/#comment-46732</guid>
					<description>Hmm...I think if your data structure is being extended a lot you would need to revisit your visitor implementations frequently.  What's your hesitation?</description>
		<content:encoded><![CDATA[<p>Hmm&#8230;I think if your data structure is being extended a lot you would need to revisit your visitor implementations frequently.  What&#8217;s your hesitation?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Mark Turansky</title>
		<link>http://tech.puredanger.com/2008/05/08/dpr/#comment-46710</link>
		<pubDate>Sat, 10 May 2008 02:32:38 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/05/08/dpr/#comment-46710</guid>
					<description>I've got a problem that I was thinking of solving with Visitor.  Under what circumstances do you consider Visitor to be a bad choice?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got a problem that I was thinking of solving with Visitor.  Under what circumstances do you consider Visitor to be a bad choice?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex</title>
		<link>http://tech.puredanger.com/2008/05/08/dpr/#comment-46581</link>
		<pubDate>Fri, 09 May 2008 13:49:00 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/05/08/dpr/#comment-46581</guid>
					<description>JavaOne usually makes all of the slides available after a couple weeks.  Or drop me an email (see bottom left of this page).</description>
		<content:encoded><![CDATA[<p>JavaOne usually makes all of the slides available after a couple weeks.  Or drop me an email (see bottom left of this page).
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
