Re: [Libxmlplusplus-general] Parser abstraction



Christophe de Vienne wrote:

again, would you derive your dom parser privately from the sax parser,
i.e. would you use 'derived from' in terms of 'implemented by', I would
(possibly) agree.



Well, after rereading this long thread, I changed a little bit my mind on the Parser abstraction, although I still have the feeling we should keep it. If the two parsers doesn't have the same semantic as far as what they produce, their parse_xxx methods do have exactly the same semantic, so why not having them in a common interface, even if in 99.00% of cases polymorphism will not be used.

the dom parser's 'parse' method(s) returns a document, the sax parser's 'parse'
method returns nothing. How's this semantically the same, or equivalent ?

(ok, I'm excluding the case where you have to assemble the document from chunks
 here)

Keeping it would permit, for exemple, to make an adaptator to be able to parse from a new type of source which would be working for both parsers.

I don't understand that. You are still talking about code reuse, right ?

Stefan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]