<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Understanding T4: &#60;#@ template #&#62; directive</title>
	<link>http://www.olegsych.com/2008/02/t4-template-directive/</link>
	<description>Interfaces are like alcohol - they are a lot of fun when used in moderation.</description>
	<pubDate>Sat, 04 Feb 2012 05:16:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3471</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Tue, 22 Nov 2011 15:09:16 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3471</guid>
		<description>@bob, I believe the analogy between .OBJ files and generated .CS holds true only if model that was used to generate code is in source control. With .OBJ files, the model is the original .C file. With T4, the model can be external to the solution; for instance, it is very common to use .TT files generate code from database schema. For practical reasons, storing an entire database under source control is feasible only in trivial cases. In a fast-paced development environment, being able to see history of changes in the generated code that could be a result of both model and the code generator changing is invaluable. 

Consider the alternative used by frameworks like ASP.NET where markup files serve as source code and the actual code is generated at run time, invisible, unless you know where to look. While this approach results in a dramatic decrease in the visible source code of the solution, it is also the most difficult to understand. As much as people loved WinForms they seemed to hate WebForms for this complexity, which is why, perhaps, Microsoft created the MVC and Web Page frameworks to address the problem.</description>
		<content:encoded><![CDATA[<p>@bob, I believe the analogy between .OBJ files and generated .CS holds true only if model that was used to generate code is in source control. With .OBJ files, the model is the original .C file. With T4, the model can be external to the solution; for instance, it is very common to use .TT files generate code from database schema. For practical reasons, storing an entire database under source control is feasible only in trivial cases. In a fast-paced development environment, being able to see history of changes in the generated code that could be a result of both model and the code generator changing is invaluable. </p>
<p>Consider the alternative used by frameworks like ASP.NET where markup files serve as source code and the actual code is generated at run time, invisible, unless you know where to look. While this approach results in a dramatic decrease in the visible source code of the solution, it is also the most difficult to understand. As much as people loved WinForms they seemed to hate WebForms for this complexity, which is why, perhaps, Microsoft created the MVC and Web Page frameworks to address the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3468</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Mon, 21 Nov 2011 23:55:36 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3468</guid>
		<description>On July 31 Oleg said, "I would be particularly concerned about not having the generated source code stored in source control repository. Because development environment can change, there is no guarantee that you can regenerate the exact same code that was shipped or delivered to production months or years ago. Troubleshooting and debugging in this situation becomes very challenging."

Boy, VS team has done everyone a disservice by training us to think like that.  The whole invention of 'source control' is to prevent that very thing.   The TT file is the source, not the CS file that comes from it.  

The template tool is equivalent to the old compiler that generated OBJ files.  No one in their right mind would check in OBJ files if they had a professional and well-designed build and development tools set.

As a matter of fact, Microsoft ran "clean" builds of the entire windows operating system even before 1995.  The never checked in OBJs, and to this day they still don't. Why?  Because the build tools are predictable, and the real source code is in source control.

Visual Studio simply blew it by ignoring their own in-house experts on software development, putting together this system that is some inferior model from the 80s.</description>
		<content:encoded><![CDATA[<p>On July 31 Oleg said, &#8220;I would be particularly concerned about not having the generated source code stored in source control repository. Because development environment can change, there is no guarantee that you can regenerate the exact same code that was shipped or delivered to production months or years ago. Troubleshooting and debugging in this situation becomes very challenging.&#8221;</p>
<p>Boy, VS team has done everyone a disservice by training us to think like that.  The whole invention of &#8217;source control&#8217; is to prevent that very thing.   The TT file is the source, not the CS file that comes from it.  </p>
<p>The template tool is equivalent to the old compiler that generated OBJ files.  No one in their right mind would check in OBJ files if they had a professional and well-designed build and development tools set.</p>
<p>As a matter of fact, Microsoft ran &#8220;clean&#8221; builds of the entire windows operating system even before 1995.  The never checked in OBJs, and to this day they still don&#8217;t. Why?  Because the build tools are predictable, and the real source code is in source control.</p>
<p>Visual Studio simply blew it by ignoring their own in-house experts on software development, putting together this system that is some inferior model from the 80s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Generate POCO classes for EF 4 Code First using a T4 template and without creating a Model &#171; Software MechaniK</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3463</link>
		<dc:creator>Generate POCO classes for EF 4 Code First using a T4 template and without creating a Model &#171; Software MechaniK</dc:creator>
		<pubDate>Sat, 05 Nov 2011 08:35:14 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3463</guid>
		<description>[...] Good guide to T4: http://www.olegsych.com/2008/02/t4-template-directive/ [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Good guide to T4: <a href="http://www.olegsych.com/2008/02/t4-template-directive/" rel="nofollow">http://www.olegsych.com/2008/02/t4-template-directive/</a> [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What’s new with T4 in the Developer Preview of Visual Studio 11? - Official T4 team blog - Site Home - MSDN Blogs</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3452</link>
		<dc:creator>What’s new with T4 in the Developer Preview of Visual Studio 11? - Official T4 team blog - Site Home - MSDN Blogs</dc:creator>
		<pubDate>Sun, 25 Sep 2011 12:05:52 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3452</guid>
		<description>[...] Previously, if you had a runtime template that declared itself as host-specific, [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Previously, if you had a runtime template that declared itself as host-specific, [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What's new with T4 in the Developer Preview of Visual Studio 11? - [Profoundly Esoteric Image] - Site Home - MSDN Blogs</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3450</link>
		<dc:creator>What's new with T4 in the Developer Preview of Visual Studio 11? - [Profoundly Esoteric Image] - Site Home - MSDN Blogs</dc:creator>
		<pubDate>Sun, 25 Sep 2011 12:03:41 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3450</guid>
		<description>[...] Previously, if you had a runtime template that declared itself as host-specific, [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Previously, if you had a runtime template that declared itself as host-specific, [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What's new with T4 in the Developer Preview of Visual Studio 11? - [Profoundly Esoteric Image] - Site Home - MSDN Blogs</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3451</link>
		<dc:creator>What's new with T4 in the Developer Preview of Visual Studio 11? - [Profoundly Esoteric Image] - Site Home - MSDN Blogs</dc:creator>
		<pubDate>Sun, 25 Sep 2011 12:03:41 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3451</guid>
		<description>[...] Previously, if you had a runtime template that declared itself as host-specific, [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Previously, if you had a runtime template that declared itself as host-specific, [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harvo Jones</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3284</link>
		<dc:creator>Harvo Jones</dc:creator>
		<pubDate>Thu, 21 Oct 2010 19:55:29 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3284</guid>
		<description>Oy, I'm such an idiot.

Burried under GAC_MSIL I found Microsoft.VisualStudio.TextTemplating.10.0.dll (without "Modeling").  For some reason this didn't show up in my .NET references, nor was in present under the IDE's PublicAssemblies directory.

Why? I don't know, but I'm all good now!

- Harvo</description>
		<content:encoded><![CDATA[<p>Oy, I&#8217;m such an idiot.</p>
<p>Burried under GAC_MSIL I found Microsoft.VisualStudio.TextTemplating.10.0.dll (without &#8220;Modeling&#8221;).  For some reason this didn&#8217;t show up in my .NET references, nor was in present under the IDE&#8217;s PublicAssemblies directory.</p>
<p>Why? I don&#8217;t know, but I&#8217;m all good now!</p>
<p>- Harvo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harvo Jones</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3283</link>
		<dc:creator>Harvo Jones</dc:creator>
		<pubDate>Thu, 21 Oct 2010 19:42:17 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3283</guid>
		<description>How have you guys been able to inherit from TextTransformation?  I'm pulling my hair out trying to find this class.

I have added this project reference:
Microsoft.VisualStudio.TextTemplating.Modeling.10.0.dll

And I have this using statement:
using Microsoft.VisualStudio.TextTemplating;

And still the class is not found.  Using Object Browser on that assembly shows TextTransformation is not in there (at least, it's not public).

Note that I'm runing .NET 4.0.30319 RTMRel and VS 2010 10.0.30319.1 RTMRel.

What am I missing guys?

Thanks!

Harvo</description>
		<content:encoded><![CDATA[<p>How have you guys been able to inherit from TextTransformation?  I&#8217;m pulling my hair out trying to find this class.</p>
<p>I have added this project reference:<br />
Microsoft.VisualStudio.TextTemplating.Modeling.10.0.dll</p>
<p>And I have this using statement:<br />
using Microsoft.VisualStudio.TextTemplating;</p>
<p>And still the class is not found.  Using Object Browser on that assembly shows TextTransformation is not in there (at least, it&#8217;s not public).</p>
<p>Note that I&#8217;m runing .NET 4.0.30319 RTMRel and VS 2010 10.0.30319.1 RTMRel.</p>
<p>What am I missing guys?</p>
<p>Thanks!</p>
<p>Harvo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mrmiles</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3216</link>
		<dc:creator>mrmiles</dc:creator>
		<pubDate>Fri, 20 Aug 2010 18:27:33 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3216</guid>
		<description>Hi,

I have written a class which inherits from TextTransformation.  Is there anyway to get a T4 Template to use this as it's base class

(I have tried using the inherits parameter, but it does not seem to work unless I use a "pre-processed template" - which is not what I want, as I want to actually generate an output, and not a class that I then run)

Do you have any idea how I go about doing this?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have written a class which inherits from TextTransformation.  Is there anyway to get a T4 Template to use this as it&#8217;s base class</p>
<p>(I have tried using the inherits parameter, but it does not seem to work unless I use a &#8220;pre-processed template&#8221; - which is not what I want, as I want to actually generate an output, and not a class that I then run)</p>
<p>Do you have any idea how I go about doing this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3159</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Sun, 13 Jun 2010 16:09:02 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-template-directive/#comment-3159</guid>
		<description>Abdul,

You can either change your template to be &lt;a href="http://www.olegsych.com/2009/09/t4-preprocessed-text-templates/" rel="nofollow"&gt;pre-processed&lt;/a&gt; or use the &lt;a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s.aspx" rel="nofollow"&gt;xsd.exe&lt;/a&gt; command-line tool.

oleg</description>
		<content:encoded><![CDATA[<p>Abdul,</p>
<p>You can either change your template to be <a href="http://www.olegsych.com/2009/09/t4-preprocessed-text-templates/" rel="nofollow">pre-processed</a> or use the <a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s.aspx" rel="nofollow">xsd.exe</a> command-line tool.</p>
<p>oleg</p>
]]></content:encoded>
	</item>
</channel>
</rss>

