Transforming Team System UML Class Diagrams into Database Diagrams and actual ORM-Classes with T4 (Update 2)

You can easily write a T4 Template that transforms UML Diagrams into Linq to SQL or Entity Framework Diagrams. The good thing to know here is that Linq to SQL and Entity Framework Diagrams are just XML Files. Also other UML Diagrams and DSL are just XML Files. So here is a screen shot of my transform:


The cool thing here is that the Linq to SQL Diagram that was generated by the transform already generated the classes for the O/R Mapping.


This is the prove point that you can do Model-To-Model Transformations with T4 in Team Systems 2010 Beta 2. Also it proves that UML and DSLs fit nicely together. UML Models can drive DSL models witch drive standard code-generation. Each step can be customized using T4 Templates.

Update: Using the T4 Toolbox of Oleg Sych – see you can also generate Visual Studio Team System Database Project (for Schema Versioning etc.) from the Linq to SQL Diagram and change the code generation. Things really start to come together now! Thanks to Oleg Sych for this great asset (

Happy Generating!


Comments (0)

Skip to main content