<?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: Descriptive Exceptions</title>
	<atom:link href="http://noopenblockers.com/2009/04/27/descriptive-exceptions/feed/" rel="self" type="application/rss+xml" />
	<link>http://noopenblockers.com/2009/04/27/descriptive-exceptions/</link>
	<description></description>
	<lastBuildDate>Fri, 04 Jun 2010 17:10:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Professor Jay</title>
		<link>http://noopenblockers.com/2009/04/27/descriptive-exceptions/comment-page-1/#comment-389</link>
		<dc:creator>Professor Jay</dc:creator>
		<pubDate>Tue, 28 Apr 2009 01:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://notebook.novasurv.com/?p=471#comment-389</guid>
		<description>I thought about that route as well, almost skipping the flags entirely and just having the exception carry the message key. It felt a bit... dirty, having the presentation logic coupled so tightly to either the backend (who did the validation logic) or the exception itself. The translation layer of flag to message key is a bit annoying, but leaves me with a more warm fuzzy design feeling  :)</description>
		<content:encoded><![CDATA[<p>I thought about that route as well, almost skipping the flags entirely and just having the exception carry the message key. It felt a bit&#8230; dirty, having the presentation logic coupled so tightly to either the backend (who did the validation logic) or the exception itself. The translation layer of flag to message key is a bit annoying, but leaves me with a more warm fuzzy design feeling  <img src='http://noopenblockers.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dgoodwin</title>
		<link>http://noopenblockers.com/2009/04/27/descriptive-exceptions/comment-page-1/#comment-388</link>
		<dc:creator>dgoodwin</dc:creator>
		<pubDate>Tue, 28 Apr 2009 00:00:36 +0000</pubDate>
		<guid isPermaLink="false">http://notebook.novasurv.com/?p=471#comment-388</guid>
		<description>Agreed that it&#039;s brutal to do a bunch of subclasses for each reason, especially in Java where that usually implies a new file, copyright notice, slew of javadoc, etc. Personally I&#039;d have been looking to avoid that catch/switch/case result though, perhaps with something like a public static final for each of your reasons IS_MISSING, REGEX_FAILS, mapping to the bundle key. (these probably being members on the InvalidChannelName exception class itself)

Then you&#039;re left with a similar throw and a much simpler catch, your switch and case can go away as you no longer need to define a second mapping for reason to bundle key, it&#039;s already in the exception. (unless that&#039;s munging your controller and view too much but given that it&#039;s not a string to display but rather a key the UI uses, it might be ok)</description>
		<content:encoded><![CDATA[<p>Agreed that it&#8217;s brutal to do a bunch of subclasses for each reason, especially in Java where that usually implies a new file, copyright notice, slew of javadoc, etc. Personally I&#8217;d have been looking to avoid that catch/switch/case result though, perhaps with something like a public static final for each of your reasons IS_MISSING, REGEX_FAILS, mapping to the bundle key. (these probably being members on the InvalidChannelName exception class itself)</p>
<p>Then you&#8217;re left with a similar throw and a much simpler catch, your switch and case can go away as you no longer need to define a second mapping for reason to bundle key, it&#8217;s already in the exception. (unless that&#8217;s munging your controller and view too much but given that it&#8217;s not a string to display but rather a key the UI uses, it might be ok)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
