What is XML Data Binding?
Business Overview
XML Data Binding simplifies the process of reading, processing, and writing XML data from your application. All the necessary code is automatically generated from your XML vocabulary description (XML Schema) and is specific to your problem domain.
Technical Overview
The technical side of XML Data Binding is straightforward:
instead of manually extracting the data stored in XML using
APIs such as DOM or SAX, automate this task by presenting the
data as C++ class objects which model the vocabulary you are
working with. For example, instead of looking for an element
named "age"
and then converting its text content
to an int
, you simply call a function called
age
which returns the age as an integer.
Why Use XML Data Binding?
Business Reasons
- Faster time to market. Instead of having engineers spend months or years on the boiler plate code, let them concentrate on what makes your product unique—the business logic.
- Minimize risks. The generated code is more reliable and has fewer bugs thanks to the repeated and widespread use. Reduction in the amount and simplification of the business logic code engineers have to write by hand further reduces the risks.
- Reduce costs. Automatic code generation is significantly cheaper than manual development. Furthermore, simplified business logic implementation means lower maintenance and development costs.
Technical Reasons
- Ease of use. The generated code provides parsing and serialization functions that automatically converts the object model to/from XML. As a result, you are shielded from the intricacies of reading and writing XML.
- Natural representation. You work with the XML data using your domain vocabulary instead of generic elements, attributes, and text.
- Static typing. The generated object model is statically typed which helps catch errors at compile-time rather than at run-time.
- Concise code. Thanks to the object representation, your business logic implementation is simpler and thus easier to read and understand.
- Maintainability. Automatic code generation minimizes the effort needed to adapt your application to changes in the document structure. Thanks to static typing, the C++ compiler will pin-point the places in your code that need to be changed.
Why Use CodeSynthesis XSD?
Business Reasons
- Open-source. CodeSynthesis XSD is dual-licensed under the GPL and a proprietary license. Even if you choose to use the proprietary license you still get full source code, including the compiler. This means no vendor lock-in as well as the ability to customize the compiler in-house or by contracting a third party. See Licensing for more information.
- Cross-platform. No matter which platforms and compilers you are using or will be using in the future CodeSynthesis XSD supports them. See Supported Platforms and Compilers for details.
- Proven. CodeSynthesis XSD has been successfully used in the industries with the most stringent quality and reliability requirements, including aerospace, defense, and telecommunications. See CodeSynthesis XSD Customers list for more information.
- Exceptional support. Support is provided by the same full-time engineering team that does ongoing maintenance and development. This ensures that you get the best advise from the source. Check our support mailing list archives for real support stories.
- XML and C++ expertise. Tap into our XML processing and cross-platform C++ knowledge to help you develop your application.
Technical Reasons
- Stream-oriented processing model. Unlike other products, CodeSynthesis XSD supports event-driven, stream-oriented XML Data Binding in addition to the traditional in-memory model. This allows you, for example, to handle XML documents that are too large to fit into memory or perform immediate processing as parts of the document become available.
- Elegant and portable C++ mappings. We took great care in designing our XML Schema to C++ mappings to ensure that they are portable and enjoyable to work with. See what real users have to say about CodeSynthesis XSD.
- Comprehensive XML Schema feature coverage. CodeSynthesis XSD includes complete support of the W3C XML Schema specification for validation and supports all important and widely used features for data binding. This is further verified by a large body of complex, real-world schemas that were successfully used with XSD.
- High performance and small footprint. CodeSynthesis XSD uses one of the fastest validating XML parsers for the in-memory mapping. The stream-oriented mapping goes one step further and performs highly-optimized validation and event dispatching in the generated code which results in 2-10 times faster parsing and validation compared to general-purpose validating XML parsers.
- Easy integration. CodeSynthesis XSD can be seamlessly used with a large number of libraries, including the C++ standard library, Boost, XDR, and ACE, as well as build systems and IDEs, including Visual Studio, QtCreator, Eclipse, make, and CMake.
Case Study
RUAG Electronics, a subsidiary of the RUAG Holding, is a European expert in high-precision technologies for the aerospace and defense sectors as well as for the automotive, semiconductor and mechanical engineering industries. The company has selected CodeSynthesis XSD for its Simulation & Training systems.
The company's needs for XML Data Binding amounted to 50,000 lines of the generated code. By using CodeSynthesis XSD, RUAG Electronics saved an estimated 24 person-months of effort, at least EUR 85,000 in development costs, and reduced time to market by at least 12 months.