Re: [Libxmlplusplus-general] Status



Murray Cumming wrote:

We had already stated (not clearly) that no-one should create Nodes or
Attributes directly. I would not expect the API to work if someone did.

stating it is one thing, making certain things impossible by correctly
using the 'public' and 'private' keywords is another.

The Node constructor/destructors are called by libxml2 when the corresponding xmlNode, xmlAttr, etc. objects are created/destroyed,
meaning the implementation (xmlNode) owns its own wrapper (xmlpp::Node).


Is that an additional point? It seems like implementation to me?

ownership semantics is certainly more than an implementation detail.
It's part of the semantics of the API.

If I look int a new API and I find functions methods that return object
pointers, my first question is 'who owns that' ?

And if the answer is 'the callee', I'd ask 'and how can I create an object that is not owned by the callee' ? Etc., you get the idea.

In the context of manipulating a DOM tree, an important question is
(as I already mentioned) how to take out a subtree, put it into
another context, or even another document. That's something that
hasn't been addressed yet, and which should be added before the
API can be considered complete.

Stefan





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