Eden Ridgway's Blog

.Net and Web Development Information

  Home :: Contact :: Syndication  :: Login
  105 Posts :: 1 Stories :: 78 Comments :: 3 Trackbacks

Search

Article Categories

Archives

Post Categories

Development

General

Something I've used for quite some time is one or other tool to generate the mundane repetitive code for a project. At my current company we have our own code generator which uses either a custom template based scripting language or XSLT. Most people know about LLBLGen and CodeSmith which have always had their free and commercial offerings.

While I was searching around on SourceForge I came across the following code generation tools:

  • Visual Studio XGen (http://vsxgen.sourceforge.net/) - This allows one to use a an XSLT script to generate code from within Visual Studio. It adds two transform commands to the tools menu in Visual Studio which will then search your solution for .xtr.xml. With an XML document like the one below, you would create a transform to replace out certain placeholders (of course you could do a lot more if you wanted to):
    <?xml version="1.0" encoding="utf-8" ?>
    <xsource>
    using System.Xml;
    using System;
    using System.Runtime.Serialization;

    namespace ConsoleApplication1 {
    <exception name="ExampleException1" base="ApplicationException" />
    <
    exception name="ExampleException2" base="ApplicationException" />
    }
    </
    xsource>
  • Dingo (http://dingo.sourceforge.net/) - This is really a schema compiler and works in much the same way that Visual Studio generates code from an XSD document. The focus of this library really is to create objects that serialise properly. Of course the entire concept could be extended into an XSD based code generation approach (which of course is actually and XML based approach). For more on using XML schemas for code generation, check out:
posted on Thursday, July 07, 2005 3:34 AM
Comments have been closed on this topic.