Peter B. West wrote:

But of course, I'm talking about Folio, which was built on a pull-parsing model before I had ever heard of pull-parsing, because it was the screamingly obvious thing to do. It gives me acute pleasure to see my original design decisions vindicated by the the development of the StAX API, and the current surge of interest. So, all of this, and more, _is_ the case. My invitation stands.


I haven't looked at Folio yet. Perhaps it's screamingly obvious that it needs a pull model. If so it's the first such application I've encountered. The really useful pull models are implemented on top of tree structures, and provide random access. I've yet to see a case where a one-way streaming pull parser did anything that couldn't be accomplished equally easily and efficiently with a push parser.

The primary benefit to pull parsers is that some developers either don't understand or simply don't like the observer design pattern as embodied in push parsers, and prefer the iterator design pattern as embodied in pull parsers. Whatever floats your boat. However there's no evidence that either pattern is in any way fundamentally superior to the other, except as a matter of developer taste.

As a practical matter, existing SAX parsers are much better optimized and debugged than existing StAX parsers. They're simply a more mature product.


--
´╗┐Elliotte Rusty Harold  [EMAIL PROTECTED]
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

Reply via email to