Re: [Saxdotnet-devel] Merging the IXmlReaderControl with IXmlReader
Brought to you by:
jeffrafter,
kwaclaw
From: Karl W. <ka...@wa...> - 2004-12-07 20:34:03
|
> Karl Waclawek wrote: > > > > Mostly for simplicity of coding. > > Let's say your factory returns an IXmlReader. > > Then you just check the reader-control feature > > (I think we haven't metioned that yet) > > and go on coding with Resume() and Suspend(). > > I don't find this simpler at all. The simple, obvious solution is to > either have a separate factory that creates suspendable parsers or have > a separate getSuspendableReader method. If the client knows they want a > suspendable parser, then let them ask the factory for one instead of > asking for some parser and getting back Lord knows what. And what if the client doesn't know? What if an application provides extra functionality depending on whether the system configured parser supports it? Even the demo application works like that. > It might be worth looking at how JAXP's SAXParserFactory class works and > consider using something along those lines that allows you to set > features and properties on the factory rather than on each individual > XmlReader. In general, adding such functionality to the factory might be useful, regardless of the above. Do you have a link at hand? If not, don't bother, I'll search Google. Karl |