[xsd-users] Visitor pattern automatically generated/ and/or included

Sumant Tambe sutambe at dre.vanderbilt.edu
Sat Jul 18 23:33:15 EDT 2009


Hi Boris,

> The problem with automatically generating the Visitor mechanism is
> that the Visitor class needs to define the visit() function for each
> type in the object model. When you have separate compilation of
> schemas that are included or imported, this becomes a very tricky
> task.
Can you please elaborate the difficulty here? What do you mean by separate
compilation of schemas?

> So it looks like the best bet to get this automated would be to
> define the Visitor class manually and then customize the code
> generator in XSD to emit the accept() function implementation
> for each object model class. If you would like, I can give you
> some pointers on how to do the customization.
Is such customization possible without recompiling the code generator?
Anyways, I'm interested in learning more on how to do this.

> BTW, is anybody else interested in this functionality?
Finally, I' extremely interested in the functionality! In fact, part of my
research work in Vanderbilt University has focussed on improving such
traversals in a type-safe way. You and the xsd-users subscribers might be
interested in a research paper that I recently presented at a
domain-specific languages conference. I blogged about it here.
http://cpptruths.blogspot.com/2009/03/leesa-new-way-of-xml-programming-in-c.html
Interested readers will find a lot of pointers to existing work on
traversal programming in the paper.

I thought this thread would be a prefect place to introduce this paper.
I've heard comments from the researchers. I'm interested in gaining
feedback from C++ developers who deal with schemas and traversals on a
day-to-day basis. Critical and constructive comments are welcome.

Thanks,

Sumant.

----------------------------------------------
Sumant Tambe
Research Assistant
ISIS, Vanderbilt University
Email: sutambe at dre.vanderbilt.edu




More information about the xsd-users mailing list