Note:
This generator can be used from within Visual Basic Express 2005 Beta.
See related article.
| |
This POC reproduces the VisualBasic.NET (VB.NET)
code produced by Kathleen Dollard's generator
in her article "Generate .NET Code With XSLT", published on
VisualStudio Magazine.
The generator of this POC produces VB.NET classes that provide
strongly typed access based on a database's XML Schema Definition.
A thorough description of the generator's input and of the generated code
is provided in "Generate .NET Code With XSLT".
Kathleen's generator is based on Extensible Stylesheet
Transformations (XSLT), while this POC
generator exploits Tefigel's XML processing and file generation
capabilities.
In particular, this refactored version of the generator also
exploits new Tefigel constructs, that allowed to significantly simplify
the generator structure in comparison with the generator of
the previous paragraph
.
Purpose of this POC is to demonstrate portability of code generation
across different code generators, realized with different techniques:
the same input model processed by different generators produces
the same code.
Another purpose of this POC is to demonstrate the
adaptability of the Somusar/Code Generator Building[sm] service: the POC generator reproduces
the same coding style (indenting, naming convention for the
identifiers) of Kathleen's code.
The XML input file used in the POC is the same as the
"Simplified XML document describing schema" from Kathleen's article
and is linked to from the following table.
Table 28 - Input Design Files
File name
|
Source code
|
Northwind.xml
|
View
|
Table 29 - VB.NET Generator: Generated Files
File name
|
Source code
|
Northwind.vb
|
View
|
Table 30 - VB.NET Generator: Sample Generator Internal Code
Description
|
File name
|
Source code
|
Main VB.NET template
|
vb_gen/templates/vb_body
|
View
|
DataTable Class template called by "vb_body"
|
vb_gen/templates/datatable_class
|
View
|
XML processor to read database table metadata
|
vb_gen/xml_table/tag_node.in
|
View
|
Main generator script
|
main.tefigel
|
View
|
[Previous chapter]
[Next chapter]
[Back to top]
|