Content deleted Content added
m →XML data binding frameworks: version bump |
m for consistency, clarify "unmarshalling" also as "deserialization" and remove "un/serialization" -- these words were/are used interchangeably again later |
||
Line 5:
An XML data binder accomplishes this by automatically creating a mapping between elements of the [[XML schema]] of the document we wish to bind and [[Instance variable|members]] of a [[Class (computer science)|class]] to be represented in memory.
When this process is applied to convert an XML document to an object, it is called [[Serialization|unmarshalling]] (also called deserialization). The reverse process, to serialize an object as XML, is called [[marshalling (computer science)|marshalling]].
Approaches to data binding can be distinguished as follows:
Line 17:
Since XML is a document-oriented format and objects are (usually) not document-oriented, simple XML data binding mappings may ignore some of the structural information embedded in an XML document. Specifically, information such as [[comment (computer programming)|comment]]s, XML entity references, and sibling order may not be preserved in the object representation created by the binding application. However, this is not always the case; sufficiently powerful XML data binding tools are capable of preserving 100% of the information stored in an XML document.
Similarly, since objects residing in computer memory are not inherently sequentially stored, and may include links to other objects (including self-referential links), simple XML data binding mappings may not be capable of preserving all the information about an object when it is marshalled to XML. However, sufficiently powerful data binding tools perform graph structure analysis on objects residing in memory to marshall (cyclic) object graph structures in XML by utilizing
==Alternatives==
An alternative approach to automatic data binding relies instead on hand-crafted [[XPath]] expressions that extract data from XML. This approach has some benefits, but also has some drawbacks. First, the approach only needs proximate knowledge (e.g., topology, tag names, etc.) of the XML tree structure, which developers can determine by looking at the XML data. Furthermore, XPath allows the application to bind the relevant data items and filter out everything else, avoiding the unnecessary processing that would be required to completely unmarshall the entire XML document. The drawback of this approach is the lack of automation in implementing the object model and XPath expressions. Instead, the application developers have to create these artifacts manually, which is time consuming, potentially error prone and hampers application maintenance when XML schemas and XML content models are updated. Another drawback is the lack of XML schema verification,
==Data binding in general==
One of XML data binding's strengths is the ability to [[serialization|
==XML data binding frameworks==
|