Re: [Saxdotnet-devel] Merging the IXmlReaderControl with IXmlReader
Brought to you by:
jeffrafter,
kwaclaw
From: Karl W. <ka...@wa...> - 2004-12-07 20:13:48
|
> Is it possible these could be no-ops instead of throwing exceptions? I > find all this talk of methods that sometimes work and sometimes don't to > be very confusing. > > For a class like XmlReader that is accessed directly by the programmer, > rather than being passed in as an argument or used through a callback, > wouldn't it be preferable to have subclasses with extra functionality? > Why do we need to stuff every method into one interface? 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(). Otherwise you have to perform a type cast, and you have to use a second variable of type IXmlReaderSubclass as initally all you got is an IXmlReader. Or, as it was with the old and separate IXmlReaderControl interface, you have to keep two references to the parser, one for the standard IXmlReader functionality, and one for using the suspend/resume feature. Karl |