6Jun/090
Code Generation Part II – Creating a Code Generator With C#, XML and XSLT
Overview
[inline][/inline]This article is the second in a series of Code Generation articles that will demonstrate the basic concepts of using code in combination with freely available tools to generate code and eliminate hours of tedious and repetitive work. This article builds on the previous article in both knowledge and code and is recommended reading prior to moving forward. In this article we will examine key concepts in generating code from XML metadata with XML related objects from the System.Xml.Xsl assembly of the Microsoft .Net Framework. This article will deal with the following and build upon:
- Specifying new elements in the App.config file, wrapping the keys in the LibraryConstants class, and new properties to the CoreBase class that will expose values set in the App.config file
- Add support enumerations and classes to the CodeGenerator.Core assembly
- Creating the CodeBuilder class that will derive from MetadataGenerator in order to create a single point of execution for code generation purposes
- Create basic templates for the generation of stored procedures based on our database schema
- Modifying the CodeGenerator application to make use of the finished CodeGenerator.Core assembly