Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
The Somusar/SoProTech[tm] Booklet Series
Volume IX

"Code Generation Somusar Style"

Printer friendly

1. Introduction
2. Reproducing a POC on Your Computer
3. J2EE Generator
4. .NET Generator
4.1 Proof-of-concept (POC) Information
4.2 Description
4.3 C# Generator: Database Access Layer
4.4 ASPX Generator: Test Pages
4.5 SQL Generator: Building a MySQL database
5. PHP Generator
6. Java (J2SE) Generator
7. Bare Bones Multitier Generator
8. XML Processor
9. XML Generator
10. API Generator Producing C and HTML
11. VisualBasic.NET Generator Draft
12. VisualBasic.NET Generator
13. XML to Java Generator
14. PHP/HTML Generator
15. Java and JSP DAO Struts Generator
16. Further Reading

Chapter 4 - .NET Generator

4.1 - Proof-of-concept (POC) Information        top

4.2 - Description        top

This compact POC faithfully reproduces the C#/ASPX/SQL code generated by Jack Herrington in his article "Creating Portable Applications with Code Generation", published on DevX.

Purpose of this POC and of the POC in the next paragraph is to demonstrate portability of code generation at two different levels:

  1. Across different target platforms (.NET and a PHP stack, in this case), as already shown in Jack Herrington's article;

  2. Across different code generators, realized with different techniques: the same input model processed by two different generators produces exactly the same code.

Another purpose of this POC is to demonstrate the flexibility and adaptability of the Somusar/Code Generator Building[sm] service: the POC generator reproduces exactly the same coding style (indenting, naming convention for the identifiers) of the original code.

The generator of this POC produces SQL code that builds a simple database, a C# database access layer for that database, and ASPX test pages. The input model for the generator is provided by the same XML file used as input model in the aforementioned article.

All output files are generated from the input model file listed in the following table.

Table 7 - Input Design Files

File name Source code
input.xml View

4.3 - C# Generator: Database Access Layer        top

Table 8 - C# Generator: Generated Files

File name Source code
bin/Author.cs View
bin/Book.cs View
bin/Publisher.cs View
bin/make.bat View

4.4 - ASPX Generator: Test Pages        top

Table 9 - ASPX Generator: Generated Files

File name Source code
asp/Author.aspx View
asp/Book.aspx View
asp/Publisher.aspx View
asp/index.aspx View

4.5 - SQL Generator: Building a MySQL database        top

Table 10 - SQL Generator: Generated Files

File name Source code
mysql/data.sql View
mysql/schema.sql View

[Previous chapter]    [Next chapter]    [Back to top]

http:// www.somusar.com  / doc  / booklets  / cg_somusar  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster