In this section you will find a home grown code generator based on templates. The idea behind code generetion is that most applications use databases to save large amounts of data.
As a developer of this kind of applications, you alwasys have to create forms and classes that 'bind' to database tables. Forms are used to display record contents and classes to read and write data from / to database. I never liked the idea of giving editable powerful data-grids to my clients and furthermore I don't like to use recordsets / datasets / datatables (depends on development platform - you can name it whatever you like) to actually save data to database (stored procedures and insert / update statements are preferred). To sum-up, 'tables' are 'classes' in the context of ClassGenerator.
The generator is implemented in VB 6.0 and is the result of a very long process (more than 4 years). Of course is not supported any more (no new features will be implemented) and based on the fact that VB 6.0 is semi-obsolete nowadays, no source code is available to the public. In case you are desperate to review, please contact us.
With any code generator, is quite easy to create classes, web pages (mainly CRUD pages) and stored procedures. This implementation provides the following features:
-
IF - THEN - ELSE statements (nested clauses are allowed)
-
FOR - NEXT loops (nested clauses are allowed)
-
Local variables - basic functions are supported for integers
-
Plain old ASP syntax for statement declaration (<% statement_name %>)
-
Statement declaration is not fixed to ASP syntax, you can declare your own START and END tags
-
Types mapping for use with other languages (it's type-set defaults to VB 6.0 - there couldn't be any other way)
-
Use multiple templates for each table
The target / generated code (platform, language, etc.) is up to you, who actually have to create the templates.
A few samples are provided to show it's usability (VB.NET classes and MS SQL Server stored procedures).
Note: Many code generation tools already exist (most of them are very powerful), that are open source and active (e.g. MyGeneration, CodeSmith and SmartCode). The above tool is not, by any means, competitive to those active projects.