Skip to main content

Jack Herrington

Jack Herrington is the author of Code Generation in
Action and the editor of the Code
Generation Network. He is a software engineer with over twenty years of
experience on numerous platforms and languages. He lives with his wife, Lori,
and daughter, Megan, in Union City California.



Jack Herrington just wants to access nodes in an XSL document by id and pull out values. With the typical Java DOM-parsing approach, it takes dozens of lines, complete with annoying casts. But by letting Groovy manage the ugly XML details, he shows how your Java code can be much prettier.
Continuing his series on code generation, Jack Herrington banishes the awkward subclassing of generated code with the idea of "safe zones," which allow handwritten code to peacefully coexist with generated code.
Jack Herrington argues that machine-generated code not only solves problems of drudgery, but it can even be preferable to potentially buggy ,hand-written code. In Part 1 of his series on code generation, he shows how XSLT can be used to generate Java source from XML descriptor files.