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:
- Across different target platforms (.NET and a PHP stack, in this case), as already shown in Jack Herrington's article;
- 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
|
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
|
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
|
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]
|