
Phil Endecott wrote:
Doug Gregor wrote:
On Jul 9, 2007, at 11:12 PM, Stefan Seefeld wrote:
I'm using here libxml2 as backend
I want a seamless mapping that doesn't impose any unnecessary copying or other indirection to mitigate the 'impedance mismatch'.
This is a very, very, very, very, very good approach.
[I have quoted Stefan's words in the hope that I've captured the core of what Doug is agreeing so emphatically with - I hope I've got it right.]
Aiming for the minimum overhead in your libxml2 wrapper is a valid objective. But perhaps in that case you should be selling this as a "C++ wrapper for libxml2", not as a "Boost XML library"? I would have thought that a largely backend-independent (or self-contained) library with STL-like interface would be more "Boost-compatible".
What about my proposed interface is libxml2-specific, prompting you to call it a 'libxml2 wrapper' ? Making the wrapper as thin as possible, yet making the API itself backend-agnostic (and thus allow it to be reimplemented with other backends) is part of the balance I was talking about, too.
Does anyone have any experience of how little overhead could be involved in going from
e.attributes["foo"]="blah"; to e.set_attribute("foo","blah"); ?
That is pure syntactic sugar. Yes, this can be done using some proxy classes. Why should we worry about such details at this point ? Regards, Stefan -- ...ich hab' noch einen Koffer in Berlin...