|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Variety of XML questions;questions that affect the design of objects I am building, and was wondering if anyone had any input or experiences to relate. Apologies if any of these answers truly should be RTFM, I'm just spooling the current questions I have off of my brain and am not sure where to look for these answers. When you grab a reference to an XMLNode, will changes to the siblings or parents affect the reference? Are pointers / references to individual nodes created upon parsing, or upon demand? (Does parsing create the node instances, or just parses the XML into another format?) Will deleting the parent node make the child node reference invalid or orphaned? Bearing encapsulation and concurrency in mind, should an object that makes changes to a node copy the node, edit, then replace the node in the original document? Or is it a better practice to work with the node in the document? For example, an Inventory object would have an XML property that is set to a node in a larger document, and it's properties are XPath queries against the node's attributes, children, and sometimes parents & siblings. A property might return Item objects which are similar objects relating to assigned child nodes. I'm told that encapsulation dictates that the object should encapsulate it's own data to protect it against changes, but that seems to me to be contrary to the spirit of an XML document (and/or message) - that since the document is basically a datastore, one should be able to bind to a location in the store and edit freely while other objects may also be able to edit the data at the same time. Thanks for your thoughts. -jim |
|||||||||||||||||||||||