meta-model driven T4 generation

Jun 21, 2010 at 8:04 PM
Edited Jun 21, 2010 at 8:05 PM
Nube question for T4. I am looking into T4 to help us with standardizing code patterns in an enterprise business application project by templating as many application layers as possible. I have used openArchitectureware 6 years ago in the Java world and and am kind of looking for the same or better functionality with T4. Back then it worked in the following fashion. 1. Java classes that defined meta models for the specific group of business applications 2. ApplicationMetaModel java class where we instantiated relevant meta models for a business application, set meta model properties, stuffed them into several lists and then asked the generator to do its magic by passing the application meta model into it. 3. Template text files (just like the T4 .tt files). The generator runtime passed the metamodels to the template files where each template file knew how to look through the metamodel instances, select the metamodels of interest for this specific template file, and then based on the metamodel properties, and the 'business logic' in the template file, generate one or many code files. 4. Infrastructure classes: these were the base classes, helper classes that were referenced by the generated business application code. e.g. the generated Customer class inherits some BaseEntity class. So I am looking for a toolbox on top of T4 to enable me to do a meta-model driven business app development for internal usage. Can the current version of T4 (VS2010) and this T4 toolbox provide similar functionality.
Coordinator
Jul 13, 2010 at 12:47 PM

There are several different ways to accomplish this with Visual Studio and T4. Here is one possible model-driven approach: http://www.olegsych.com/2010/01/uml-modeling-and-code-generation-in-visual-studio-2010/ and one possible code-driven approach: http://www.olegsych.com/2007/12/how-to-use-t4-to-generate-decorator-classes/.

Oleg