Following on from a taster that I posted before: http://lordzoltan.blogspot.com/2010/09/pseudo-template-meta-programming-in-c.html , here goes with the next piece. Firstly, the design I'm showing here can be applied to any reflection scenario - I've deployed it in various guises, including for storing meta-data about methods in a class, properties, and even for compiling dynamic methods that provide late-bound functions. The primary reason why this design, I feel, is particularly useful is that you're making the .Net type engine do all the hard work of storing all this meta-data for you. I'll go through this by looking at a really simple scenario: You want to write a system whereby you can reflect properties of a type that a developer writes in order to provide some form of functionality. Let us say that you want to write a dictionary state-bag wrapper, where a property is wrapped around an internal dictionary of values. What you want is to have a code-generation ...
Replacing my old blog at http://www.lordzoltan.org. C#, rants and other brain vomit