[xsd-users] Visitor pattern automatically generated/ and/or
sutambe at dre.vanderbilt.edu
Sat Jul 18 23:33:15 EDT 2009
> 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
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.
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.
ISIS, Vanderbilt University
Email: sutambe at dre.vanderbilt.edu
More information about the xsd-users