|
Without higher order functions or a decent macro system code gen is the only way to get some things done in Java. Using XML files to define the attributes of an object we generate all of the persistence classes we need. We also have a custom code gen application to convert .form files from NetBeans into custom Java dialog classes (there is a method to our madness here and reasons we can't use the default NetBeans code).
One important note is that it's best to generate classes that are designed for extension by overriding rather than by including hand coded sections in the generated code. This is much easier to manage.
Our code generation framework is straight XSLT, though sometimes it's encoded using XSLTXT for ease of development and maintenance.Anything that's too tedious in XSLT can be done with a python preprocess step. This makes best use of our skill sets.
|