From: Anton v. S. <an...@ap...> - 2002-04-28 23:27:38
|
Since I said I would, I've put up a copy of my nascent XSLT code generator at http://www.appsolutions.com/hibernate/BeanGenerator/ There's a ZIP file which you can download if you want to play with it, and links to the source files if you just want to look at them. There's a readme.txt included with a bit of info about its use, features, and current limitations. It's very small and simple: a 47-line XSLT file, and a supporting Java class that's about 80 lines, excluding comments. The XSLT does a fair amount of magic in terms of understanding and handling the Hibernate mapping file format, and this keeps the overall code size down. It's not my intent with this to "compete" with Brad Clow's generator, but some cross-fertilization of ideas is never bad, IMO. In fact, I'm very much in favor of the kind of high-level approach Brad described: > our goal is to use the code generator to generate the javabean classes > defined in the mapping file, as well as many of the other classes, web > pages, etc. that use them. I have another set of Java classes to reverse engineer a database and generate a Hibernate mapping file. The overall architecture of that is somewhat similar to Brad's generator, since I wrote it with a view to making it part of a more general metadata manipulation suite of the sort we've been discussing. I think this could be integrated with Brad's generator without much problem, so I may post more on that subject over the next few weeks. Anton P.S. Any feedback on my use or abuse of XSLT is welcome - I last used it seriously in 1999... |