Data binding to Python Java C[++,#]?

Discussion in 'XML' started by Cees Wesseling, Jan 24, 2005.

  1. For a couple of years I am using now my own data binding tool that can
    create C++ classes from a DTD. At this moment I need to reconsider
    this tool since I want to use W3C XML Schemas and need to output to
    more languages: C, C++, C#, python and Java. In reviewing existing
    tools I came the following preliminary conclusions on which I like
    your comments:

    - there is no single open source tools capable of supporting all the
    mentioned languages on both Windows and linux.
    - existing tools generate too complex object models in the target
    language for type of documents I am processing (see below).

    The type of documents I need to process have schema's designed by
    myself and only the elements and attributes are significant. Others
    things such as processing instructions are ignored, except of course
    the relevant info in the Document Type Declaration. The type of
    schema's I am designing do have a number of restrictions that makes
    mapping to an object model easy:
    1) mixed content elements are not allowed
    2) sibling elements can only have the same name if they are direct
    3) if an element has an attribute named X it can not have an child
    element named X.

    The restrictions do make for easy name selection in the target object
    model. For example:

    <El Attr="1.34">

    to C++:

    class El {
    double d_Attr;
    Child1 d_Child1;
    std::vector<Child2> d_Child2;

    Note that the actual implementation has a more complicated definition
    of the child types to get control over it contents. E.g. even a simple
    double like Attr is actually wrapped in some sort of set/get mechanism
    that can validate, serialize and deserialize the value.

    The tool should generate an easy to use object model in the target
    language with as little knowledge required by the client programmer
    besides the structure of the object model itself. In other words,
    minimizing knowledge on XML issues, DOM tree processing, etc. The
    generated code should catch validation errors as soon as possible:
    some already at a possible compilation, others at executing phase. I
    do assume for each target language and operating system a DOM Api and
    xsd validator to be present and callable from the generated language.

    Performance is not an issue, the documents are assumed to be small.
    All processing in my current tool is done using DOM with excessive
    copying and cloning around to keep things small from a tool
    development perspective.

    I am aware of existing tools for Java (Castor) and Python (Amara) and
    commercial tools supporting C++ and C# (MS SDK). But I am considering
    to create such a tool that can target all languages myself, maybe by
    wrapping existing tools, and release it as an open source project. Of
    course the first questions then are:

    - Is there are already something familiar out there I can join?
    - Is there a commercial tool I must consider for efficiency/time
    - Has anyone experience in targeting multiple languages, by using
    probably multiple tools?
    - If not, who is interested in such a tool? Or are my requirements too
    - What other newsgroups, mailing lists, SIG's are a suitable platform
    to discuss my questions and ideas?

    I stop here with describing my existing and wished tool, although I do
    have already a lot of specifications and things on my wish list where
    such a Data binding generation tool should go to. For example, the no
    "mixed contents allowed" restriction can be dropped, by including
    generic XML trees that are can be kept and set, but need straight DOM
    or SAX processing with little help from the generated object model.

    Thanks for your time.

    Cees Wesseling
    Cees Wesseling, Jan 24, 2005
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jordan
    Feb 10, 2004
  2. Amit
    Oct 24, 2006
  3. Replies:
    Kevin Grover
    Oct 20, 2006
  4. JcFx
  5. Vivek Nallur

    value binding and function binding

    Vivek Nallur, Sep 25, 2003, in forum: Ruby
    Vivek Nallur
    Sep 25, 2003

Share This Page