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
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
12.1 Proof-of-concept (POC) Information
12.2 Description
12.3 VB.NET Generator
12.3.1 Have a peek into this generator's internal code!
13. XML to Java Generator
14. PHP/HTML Generator
15. Java and JSP DAO Struts Generator
16. Further Reading

Chapter 12 - VisualBasic.NET Generator

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

12.2 - Description        top


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

12.3 - VB.NET Generator        top

Table 29 - VB.NET Generator: Generated Files

File name Source code
Northwind.vb View

12.3.1 - Have a peek into this generator's internal code!        top

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]

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