Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StringTemplate for runtime code gen?

I am working on a project that generates code at runtime based on meta-model. I've used vb.net xml literals for this, but today I ran across StringTemplate project. Has anybody successfully used this library in C# project.

like image 351
epitka Avatar asked Aug 28 '09 14:08

epitka


1 Answers

StringTemplate is probably the most awesome and well-designed templating engine in existence today. It's definitely a good pick regardless of the language/platform you use.

On the other hand, ther's also T4, which is "more standard" (comes with VS, reusable, a lot of .NET devs know it already), and in VS2010 it comes with "precompiled templates", where your template is converted to raw C# code at design time, which is compiled as part of your project - which is fast, and has no runtime dependencies.

like image 155
Pavel Minaev Avatar answered Sep 19 '22 01:09

Pavel Minaev