<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Choosing a Template Engine for code generation</title>
	<atom:link href="http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/feed/" rel="self" type="application/rss+xml" />
	<link>http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/</link>
	<description>Abstraction based levitation</description>
	<lastBuildDate>Fri, 04 May 2012 10:14:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Marcus Munzert</title>
		<link>http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/comment-page-1/#comment-9</link>
		<dc:creator>Marcus Munzert</dc:creator>
		<pubDate>Wed, 08 Jul 2009 14:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://pjmolina.com/metalevel/?p=118#comment-9</guid>
		<description>The generation tool JenerateIT itself doesn&#039;t know about how to generate Java files. It is a general purpose generation tool. It can be used to generate any kind of file, be it C++, Java, XML or any other file type.

JenerateIT provides a plug-in mechanism to add generation logic to be controlled by JenerateIT. We, amongst others, have developed generation logic that knows how to generate a Java file. That generation logic uses JenerateIT&#039;s plug-in mechanism and JenerateIT&#039;s API.

JenerateIT, through its API, provides the means to split a to-be-generated file into different sections. With this, generation logic at any time can write to any section of the to-be-generated file. The generation logic actually is writing to specific buffers and not to the physical file. The physical file then is written only at the end of the code generation process.
The aforementioned generation logic for the creation of Java files utilizes that means, for instance to generate import statements in an efficient way.

Does this throw light on my original comment and answer your question?

By the way: in a few places in generation logic we use StringTemplate to generate chunks of pure text that have only little or no variability.</description>
		<content:encoded><![CDATA[<p>The generation tool JenerateIT itself doesn&#8217;t know about how to generate Java files. It is a general purpose generation tool. It can be used to generate any kind of file, be it C++, Java, XML or any other file type.</p>
<p>JenerateIT provides a plug-in mechanism to add generation logic to be controlled by JenerateIT. We, amongst others, have developed generation logic that knows how to generate a Java file. That generation logic uses JenerateIT&#8217;s plug-in mechanism and JenerateIT&#8217;s API.</p>
<p>JenerateIT, through its API, provides the means to split a to-be-generated file into different sections. With this, generation logic at any time can write to any section of the to-be-generated file. The generation logic actually is writing to specific buffers and not to the physical file. The physical file then is written only at the end of the code generation process.<br />
The aforementioned generation logic for the creation of Java files utilizes that means, for instance to generate import statements in an efficient way.</p>
<p>Does this throw light on my original comment and answer your question?</p>
<p>By the way: in a few places in generation logic we use StringTemplate to generate chunks of pure text that have only little or no variability.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pjmolina</title>
		<link>http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/comment-page-1/#comment-8</link>
		<dc:creator>pjmolina</dc:creator>
		<pubDate>Mon, 06 Jul 2009 20:10:24 +0000</pubDate>
		<guid isPermaLink="false">http://pjmolina.com/metalevel/?p=118#comment-8</guid>
		<description>Thank Marcus from commenting about a different approach and comparing using the same terms.

When you said: &quot;Instead, when generating a Java file, you for instance can add import statements while generation logic is just writing the implementation of a method.&quot;

Then, if I understood it well, the template engine is taking in account that you are generating Java code and already knows what an &quot;import&quot; means in this context? We can say that your code generator is specially targeted for Java output, isn&#039;t it?</description>
		<content:encoded><![CDATA[<p>Thank Marcus from commenting about a different approach and comparing using the same terms.</p>
<p>When you said: &#8220;Instead, when generating a Java file, you for instance can add import statements while generation logic is just writing the implementation of a method.&#8221;</p>
<p>Then, if I understood it well, the template engine is taking in account that you are generating Java code and already knows what an &#8220;import&#8221; means in this context? We can say that your code generator is specially targeted for Java output, isn&#8217;t it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Munzert</title>
		<link>http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/comment-page-1/#comment-6</link>
		<dc:creator>Marcus Munzert</dc:creator>
		<pubDate>Mon, 29 Jun 2009 10:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://pjmolina.com/metalevel/?p=118#comment-6</guid>
		<description>Due to my experiences over the previous 7 years, I myself am not a big fan of using template engines for code generation. I am not an opposer either, though. Some years ago I was using ArcStyler (Interactive Objects GmbH) with its template and generation engine CARAT for several years. That worked quite fine for me. Then, back in 2006, I was searching for an easy-to-use object-oriented generation framework/tool that doesn&#039;t use the template approach as a core concept. Reason for that: I wanted to re-use all the benefits that OOA/OOD/OOP brings on the table and I wanted to have a flat learning curve, for me and for others. Last but not least I wanted to re-use the existing features of (Java-)IDEs. I did not find such a framework. That made me commencing to design and develop my own, simple object-oriented generation framework „JenerateIT“. Meanwhile that framework has matured and has become a general purpose code generation tool that comes with Eclipse integration and is backed by Generative Software GmbH, a company founded in 2007.

Let me try to outline how that object-oriented generation framework „JenerateIT“ performs in relation to the 7 requirements you have listed further above. Please note that if there were a „JenerateIT for Visual Studio“, you would have a similar situation for the C#/C++/.NET world. In order to avoid misunderstandings: JenerateIT does not do simple System.out.println() calls, but acts on a higher level. Amongst others this approach frees you from having to write to a file sequentially. Instead, when generating a Java file, you for instance can add import statements while generation logic is just writing the implementation of a method.

Direct recognition of the final output
=========================================
Since object-oriented code is not procedural, the code that contributes to the generation of a file cannot be seen at a glance. That&#039;s the price you have to pay in order to get all the advantages mentioned in the remainder of my post.
To improve the readability and comprehensibility of generation logic, JenerateIT comes with traceability functionality to directly show the relation between generated code and generation logic that created it. Also, you can directly jump from generated code to the generation logic code.

Easy to maintain
=========================================
Changing a template in JenerateIT (= a set of classes that implement generation logic) is equivalent to changing object-oriented Java code. So you may imagine how easy that is. Surely, you have to be familiar with Java and with object-orientation.
Additional functionality that eases maintenance tasks is mentioned in the last part of my comment on „Direct recognition of the final output“ further above.

Reusable
=========================================
From anywhere in the generation logic you have full access to all other available generation logic. And that can easily be re-used.

Minimalistic
=========================================
When you generate Java code with JenerateIT, your target language is the same as the language for programing generation logic.

Composable
=========================================
Here the same comments hold true as were given for the „Reusable“ requirement further.

Separation of Concerns
=========================================
JenerateIT doesn&#039;t care about the content that your generation logic is going to write into the generated files. It is responsible only for controlling your generation logic, handling model access and file input and output.

Idempotent
=========================================
With JenerateIT you can re-generate a file as often as you want. The content is not changed, and also, if the content doesn&#039;t change, the physical file is not being overwritten. So it keeps the original timestamp. There is an exception from that rule: if your generation logic generates timestamp information or random data into a file, obviously that file will change with every re-generation.</description>
		<content:encoded><![CDATA[<p>Due to my experiences over the previous 7 years, I myself am not a big fan of using template engines for code generation. I am not an opposer either, though. Some years ago I was using ArcStyler (Interactive Objects GmbH) with its template and generation engine CARAT for several years. That worked quite fine for me. Then, back in 2006, I was searching for an easy-to-use object-oriented generation framework/tool that doesn&#8217;t use the template approach as a core concept. Reason for that: I wanted to re-use all the benefits that OOA/OOD/OOP brings on the table and I wanted to have a flat learning curve, for me and for others. Last but not least I wanted to re-use the existing features of (Java-)IDEs. I did not find such a framework. That made me commencing to design and develop my own, simple object-oriented generation framework „JenerateIT“. Meanwhile that framework has matured and has become a general purpose code generation tool that comes with Eclipse integration and is backed by Generative Software GmbH, a company founded in 2007.</p>
<p>Let me try to outline how that object-oriented generation framework „JenerateIT“ performs in relation to the 7 requirements you have listed further above. Please note that if there were a „JenerateIT for Visual Studio“, you would have a similar situation for the C#/C++/.NET world. In order to avoid misunderstandings: JenerateIT does not do simple System.out.println() calls, but acts on a higher level. Amongst others this approach frees you from having to write to a file sequentially. Instead, when generating a Java file, you for instance can add import statements while generation logic is just writing the implementation of a method.</p>
<p>Direct recognition of the final output<br />
=========================================<br />
Since object-oriented code is not procedural, the code that contributes to the generation of a file cannot be seen at a glance. That&#8217;s the price you have to pay in order to get all the advantages mentioned in the remainder of my post.<br />
To improve the readability and comprehensibility of generation logic, JenerateIT comes with traceability functionality to directly show the relation between generated code and generation logic that created it. Also, you can directly jump from generated code to the generation logic code.</p>
<p>Easy to maintain<br />
=========================================<br />
Changing a template in JenerateIT (= a set of classes that implement generation logic) is equivalent to changing object-oriented Java code. So you may imagine how easy that is. Surely, you have to be familiar with Java and with object-orientation.<br />
Additional functionality that eases maintenance tasks is mentioned in the last part of my comment on „Direct recognition of the final output“ further above.</p>
<p>Reusable<br />
=========================================<br />
From anywhere in the generation logic you have full access to all other available generation logic. And that can easily be re-used.</p>
<p>Minimalistic<br />
=========================================<br />
When you generate Java code with JenerateIT, your target language is the same as the language for programing generation logic.</p>
<p>Composable<br />
=========================================<br />
Here the same comments hold true as were given for the „Reusable“ requirement further.</p>
<p>Separation of Concerns<br />
=========================================<br />
JenerateIT doesn&#8217;t care about the content that your generation logic is going to write into the generated files. It is responsible only for controlling your generation logic, handling model access and file input and output.</p>
<p>Idempotent<br />
=========================================<br />
With JenerateIT you can re-generate a file as often as you want. The content is not changed, and also, if the content doesn&#8217;t change, the physical file is not being overwritten. So it keeps the original timestamp. There is an exception from that rule: if your generation logic generates timestamp information or random data into a file, obviously that file will change with every re-generation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pjmolina</title>
		<link>http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/comment-page-1/#comment-5</link>
		<dc:creator>pjmolina</dc:creator>
		<pubDate>Fri, 26 Jun 2009 08:24:14 +0000</pubDate>
		<guid isPermaLink="false">http://pjmolina.com/metalevel/?p=118#comment-5</guid>
		<description>Thanks Karsten! Fore sure, I will do. I&#039;ll take the time to test Galileo with the full package.</description>
		<content:encoded><![CDATA[<p>Thanks Karsten! Fore sure, I will do. I&#8217;ll take the time to test Galileo with the full package.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karsten Thoms</title>
		<link>http://pjmolina.com/metalevel/2009/06/choosing-a-template-engine-for-code-generation/comment-page-1/#comment-4</link>
		<dc:creator>Karsten Thoms</dc:creator>
		<pubDate>Fri, 26 Jun 2009 07:58:34 +0000</pubDate>
		<guid isPermaLink="false">http://pjmolina.com/metalevel/?p=118#comment-4</guid>
		<description>Hi Pedro! Really nice overview. You should give Xpand a try, the new version has been released this week with Eclipse Galileo. I think it fulfills your requirements quite well, although it&#039;s not .NET. Would be interesting what your opinion is.
~Karsten</description>
		<content:encoded><![CDATA[<p>Hi Pedro! Really nice overview. You should give Xpand a try, the new version has been released this week with Eclipse Galileo. I think it fulfills your requirements quite well, although it&#8217;s not .NET. Would be interesting what your opinion is.<br />
~Karsten</p>
]]></content:encoded>
	</item>
</channel>
</rss>

