ONJava.com: Bug Prevention with Code Generation: A J2EE Case Study [Mar. 31, 2004]: "Once upon a time, assembler was the source code. Then compilers turned it into generatable code. The new wave of code generation reapplies, in the large, that same conceptual jump: Java, C#, PHP, COBOL, Pascal, XML, HTML, JSP, ASP, Fortran, CORBA IDL, assembler, Perl, Python, Ruby, and so forth can all be considered generatable languages, provided that you have appropriate tools to produce them. This is conceptually similar to compilers that enabled the automatic generation of assembly code.
The best site on the Internet to learn about this new wave of tools is the Code Generation Network (CGN), whose editor is Jack Herrington, author of book Code Generation in Action (CGiA). There you can find a database on available generators, a number of interviews with code generation experts, a list of recommended books on this fascinating subject, and more. Among other articles, Jack Herrington also published 'Code-Generation Techniques for Java' on ONJava.com. With CGiA, you can also learn to write your own generators, if you want to. That's a powerful technique that, once mastered, pops up in your mind very often to solve repetitive problems. Quoting from CGN, pragmatic engineers can get higher quality, consistency, productivity, and abstraction using code generation."