<?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: XML Pull Parsing and Enums: like chocolate and peanut butter</title>
	<atom:link href="http:///2007/05/31/life-on-earth/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.palantirtech.com/2007/05/31/life-on-earth/</link>
	<description>Articles from the Engineering Group at Palantir Technologies</description>
	<lastBuildDate>Tue, 24 Jan 2012 09:51:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Brad</title>
		<link>http://blog.palantirtech.com/2007/05/31/life-on-earth/comment-page-1/#comment-567</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Fri, 21 May 2010 23:17:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/2007/05/31/life-on-earth/#comment-567</guid>
		<description>Great article. I&#039;m thinking through some ways of dealing with poorly written XML handling from 11 years ago and this is thought provoking. Th XML is so bad they even wrote their own custom parsers!

In your code, why not just have the enum do it&#039;s own processing?

switch  (parserState) {
06.    case DOMAIN:
07.        processDomain();

Instead, just throw away the switch state and create a process method and do this:

parserState.process()

An Enum in Java can have an abstract method definition requiring all declared Enums to implement it. If you have an &quot;abstract void process()&quot; method declared, each of your Enums would have to implement a method for handling that call.

So if they all have process method, then each Enum executes its own processing code. It is similar to a Command class executing whatever it&#039;s logic is; the caller need not be aware of the Command doing the executing. It is only aware of the type.

The switch statement isn&#039;t needed and loses a bit of the power of it.</description>
		<content:encoded><![CDATA[<p>Great article. I&#8217;m thinking through some ways of dealing with poorly written XML handling from 11 years ago and this is thought provoking. Th XML is so bad they even wrote their own custom parsers!</p>
<p>In your code, why not just have the enum do it&#8217;s own processing?</p>
<p>switch  (parserState) {<br />
06.    case DOMAIN:<br />
07.        processDomain();</p>
<p>Instead, just throw away the switch state and create a process method and do this:</p>
<p>parserState.process()</p>
<p>An Enum in Java can have an abstract method definition requiring all declared Enums to implement it. If you have an &#8220;abstract void process()&#8221; method declared, each of your Enums would have to implement a method for handling that call.</p>
<p>So if they all have process method, then each Enum executes its own processing code. It is similar to a Command class executing whatever it&#8217;s logic is; the caller need not be aware of the Command doing the executing. It is only aware of the type.</p>
<p>The switch statement isn&#8217;t needed and loses a bit of the power of it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ari</title>
		<link>http://blog.palantirtech.com/2007/05/31/life-on-earth/comment-page-1/#comment-274</link>
		<dc:creator>Ari</dc:creator>
		<pubDate>Sun, 29 Nov 2009 22:56:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/2007/05/31/life-on-earth/#comment-274</guid>
		<description>That does look really interesting!  At the moment, we&#039;re happy with performance of our pull parser, but the ability to use XPath over large documents could be really useful -- we had to build our own validator using the pull parser to run some checks on our documents that aren&#039;t handled by normal XML Schema validation.</description>
		<content:encoded><![CDATA[<p>That does look really interesting!  At the moment, we&#8217;re happy with performance of our pull parser, but the ability to use XPath over large documents could be really useful &#8212; we had to build our own validator using the pull parser to run some checks on our documents that aren&#8217;t handled by normal XML Schema validation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://blog.palantirtech.com/2007/05/31/life-on-earth/comment-page-1/#comment-273</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Sun, 29 Nov 2009 00:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/2007/05/31/life-on-earth/#comment-273</guid>
		<description>You want want to look at vtd-xml, the latest and most advanced parsing/indexing/XPath engine that offers a lot of cool features

&lt;a href=&quot;http://vtd-xml.sf.net&quot; rel=&quot;nofollow&quot;&gt;vtd-xml&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>You want want to look at vtd-xml, the latest and most advanced parsing/indexing/XPath engine that offers a lot of cool features</p>
<p><a href="http://vtd-xml.sf.net" rel="nofollow">vtd-xml</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mk</title>
		<link>http://blog.palantirtech.com/2007/05/31/life-on-earth/comment-page-1/#comment-55</link>
		<dc:creator>mk</dc:creator>
		<pubDate>Thu, 28 Jun 2007 13:22:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/2007/05/31/life-on-earth/#comment-55</guid>
		<description>lets have some new content guys! it doesnt have to be a huge post like this one.
and keep up the good work</description>
		<content:encoded><![CDATA[<p>lets have some new content guys! it doesnt have to be a huge post like this one.<br />
and keep up the good work</p>
]]></content:encoded>
	</item>
</channel>
</rss>

