Fun use of T4 to generate strongly-typed web navigation


I wondered how long it would be before folks outside of the DSL Tools/VSX/SF community started to pick up on the fact that T4 is in every VS box as of VS 2008.

Here’s my answer…

Kirill Chilingarashvili has a nice example of turning some weakly typed data into strongly-typed data and hence moving errors from runtime to compile time.  Rarely a bad thing.  Interestingly this doesn’t even require a directive processor to be written to get the data into the template.

Nice stuff Kirill.

Comments (7)

  1. Cyril says:

    Yep. It’s clean.

    That’s simple, efficient, and addressing "stickily" enough Kirill’s specific issue (no more, no less) and, as you said, also a nice way to show how the T4 functionality in VS 2008 actually is orthogonal to the rest of the DSL Tools/VSX features.

    In my opinion, at design and functional scope levels, feature orthogonality in software development tools (whenever possible) is as important as, say, object-oriented languages’ syntactical or semantical constructs’ orthogonality, for instance.

  2. Oleg Sych says:

    Thanks for posting this, Gareth.

    I agree with Cyril and think that T4 is a bit overshadowed by DSL and GAT. As Kirill’s post shows, T4 is a great tool in its own right.

  3. Oleg saw my post about Kiril’s general-purpose use of T4 and gently pointed me at the set of resources

  4. Oleg saw my post about Kiril's general-purpose use of T4 and gently pointed me at the set of resources

  5. Gareth is obviously settled in the US now, because he’s starting to become a prolific blog poster again.

  6. Gareth is obviously settled in the US now, because he's starting to become a prolific blog poster

  7. Gareth has been posting a lot about T4 over the past few months. In case you missed it, here’s a roundup

Skip to main content