DOM guide: Introduction: Difference between revisions
m catg sort |
|||
Line 23: | Line 23: | ||
==Architecture Modules== | ==Architecture Modules== | ||
The COLLADA DOM framework includes | The COLLADA DOM framework includes three basic components: | ||
*Object Model. Includes the Digital Asset Exchange (DAE) Object Model, which is a reflective object model allowing for easy creation, manipulation, reading, and writing of COLLADA elements; and the COLLADA Object Model, a custom C++ DOM based on the DAE Object Model and the COLLADA schema. | *Object Model. Includes the Digital Asset Exchange (DAE) Object Model, which is a reflective object model allowing for easy creation, manipulation, reading, and writing of COLLADA elements; and the COLLADA Object Model, a custom C++ DOM based on the DAE Object Model and the COLLADA schema. | ||
*Runtime Database. Manages COLLADA elements. A reference implementation is provided via the Standard Template Library (STL). The Runtime Database includes the C++ structures for specific instances of the COLLADA Object Model, a mechanism for converting COLLADA Object Model elements to user-defined data structures, and a database query manager. | *Runtime Database. Manages COLLADA elements. A reference implementation is provided via the Standard Template Library (STL). The Runtime Database includes the C++ structures for specific instances of the COLLADA Object Model, a mechanism for converting COLLADA Object Model elements to user-defined data structures, and a database query manager. |
Revision as of 03:53, 26 March 2007
The COLLADA Document Object Model (DOM) is an application programming interface (API) that provides a C++ object representation of a COLLADA XML instance document.
Overview
The COLLADA DOM is a comprehensive framework for the development of COLLADA applications. The DOM provides a C++ programming interface to load, query, and translate COLLADA instance data. The DOM loads COLLADA data into a runtime database consisting of structures that mirror those defined in the COLLADA schema. These runtime structures are auto-generated from the current schema, eliminating inconsistency and error.
Design Considerations
The COLLADA DOM takes into account the following design considerations, which provide some of the desirable features of the DOM.
Simple Data Transformation
The COLLADA DOM provides a means for users to write translation code to transform data loaded into the COLLADA runtime database into data structures native to their own tools or engines. The API provides plugin points to eliminate the need to understand the underlying framework in order to write this translation.
Replaceable Backend
The DOM has implemented a repository-neutral strategy to allow for future uses of the COLLADA DOM with database systems based on XML or binary data representations. In this way, the COLLADA DOM eliminates any dependence on a particular underlying specification format.
Schema Driven
The COLLADA DOM Object Model uses structures derived directly from the COLLADA schema. The C++ definitions of these structures are generated automatically and are therefore always consistent and accurate. This correspondence means that the DOM can be kept in sync with the COLLADA schema as it is further developed.
COLLADA DOM Advantages
In addition to the preceding advantages, the COLLADA DOM provides several other advantages over using a standard XML DOM parser to read COLLADA instance documents.
- With the COLLADA DOM, you need concern yourself only with the specific elements that you want to use or modify. The other elements in an instance document are automatically preserved and are written back to the document when the data is saved.
- The COLLADA DOM automatically resolves URIs upon loading a COLLADA instance document; there is no need to write your own resolver or to search through the data to find referenced URIs.
- The API converts text strings within the COLLADA instance document into their appropriate binary forms. For example, it converts the text form of a number such as “1.345” into a C++ floating-point number.
Architecture Modules
The COLLADA DOM framework includes three basic components:
- Object Model. Includes the Digital Asset Exchange (DAE) Object Model, which is a reflective object model allowing for easy creation, manipulation, reading, and writing of COLLADA elements; and the COLLADA Object Model, a custom C++ DOM based on the DAE Object Model and the COLLADA schema.
- Runtime Database. Manages COLLADA elements. A reference implementation is provided via the Standard Template Library (STL). The Runtime Database includes the C++ structures for specific instances of the COLLADA Object Model, a mechanism for converting COLLADA Object Model elements to user-defined data structures, and a database query manager.
- Backend: The COLLADA backend consists of the components responsible for translating external COLLADA instance data into C++ runtime COLLADA objects.
These components are described in more detail in DOM guide: Architecture.