News Feeds
The MetaCode library provides a means to generate dynamic types at runtime without directly emitting CIL opcodes. The library exposes a flexible "meta-programming" model that represents code artifacts via objects, similar to the types found in System.CodeDom. Internally, MetaCode uses the types in the System.Reflection.Emit namespace to build the concrete implementations of types.

Update: Take a look at this blog post that gives a quick walkthrough of the library.

The library is structured around two object hierarchies: TypeModel and CodeModel. The TypeModel hierarchy mimics the common reflection types found in System.Reflection, such as Type and MethodInfo. The CodeModel hierarchy creates a tree of classes that represent code artifacts. Each class in the hierarchy understands how to convert itself into its corresponding CIL representation. The primary means of assembling the CodeModel types is the ImperativeCodeBuilder, which exposes an imperative interface to creating the bodies of MetaMethods.

Potential Uses
  • Mock object factories
  • Aspect-oriented programming frameworks
  • General-purpose dynamic proxy generation

MetaCode is distributed under the BSD License. Feel free to grab the source code archive from the releases page, or check a working copy out of the Subversion repository at:

http://svn.enkari.com/metacode/trunk/

More information will be coming soon. In the meantime, take a look at the simple unit tests in the source distribution for a very brief introduction to the library. Please post any questions or concerns in the forum.

Last edited Dec 7, 2006 at 10:16 PM by codeplexadmin, version 8