Code Generation in Microsoft .NET: Generator types
Today I got the book Code Generation in Microsoft .NET. I was really surprised, I have read the interviews with her at Code Generation Network but I was totally impressed of getting such a huge tome.
In chapter one Kathleen Dollard distinguish between three main types of code generators; "brute force", CodeDOM and XSLT. In a comparison table she evaluates the ease of pasting in sample code: XSLT easy, "brute force" difficult and CodeDOM effectively impossible.
I would agree totally but I think that one technique is totally missing; an ASP.NET like approach like CodeSmith, M3rlin, Cube or MyGeneration. CodeSmith and Cube uses "brute force" as engine behind, Cube loads the ASP.NET engine. Pasting in sample code into the templates is easy; the principle is powerful and familiar to all .NET users.
I prefer the way of XSLT, mainly because you are not "overlaying the syntax of the output code with the code that runs the template". But I will not ignore ASP.LIKE techniques.
I can’t wait to read on.