Tag Archives: development

Constraining Generic types to parameterized constructors

Pretty cool trick I found today on StackOverflow. I’ve often struggled with the fact that when you’re writing a generic method, while you can constrain the type of the method, you can only specify the constraint of having a constructor, and even then, only a default constructor (eg: new()); not one with parameters.

T4 gotchyas in your environment

In a previous post I wrote about the wonders of T4 and how it helped the team I’m on circumvent the loss of intellisense in our highly-decoupled Adaptive Object Model framework. In this post I want to apprise you of the various things we had to overcome to get T4 implemented in to our build… Read More »

Did you know: *Internal* interfaces on *Public* classes

So I’ll admit I’ve kind of been a more standard OOP developer. Today, however, I got a wild hair and did an F12 (Go to definition) on Tuple<t1, t2=””>. I found this: public class Tuple<t1, t2> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple And thought “ITuple? What’s that?” I went diving in to MSDN and found nothing. So I… Read More »

Text Template Transformation Toolkit tongue twister

Microsoft’s T4 (Text Template Transformation Toolkit) framework is something every software engineer should have in their back pocket. It flies right along with the OOP principle of DRY (Don’t Repeat Yourself). If you’re writing DSL descriptors and then implementing their C# counterparts to be late bound, this shit is going to add YEARS to your… Read More »