Code Generators - Java
Code generation is the process by which a compiler converts a syntactically-correct program into a series of instructions that could be executed by a machine. The input to the code generation stage typically consists of a parse tree, abstract syntax tree, or intermediate language code; the target machine may be a physical machine such as a microprocessor, or an abstract machine such as a virtual machine or an intermediate language.
From : en.wikipedia.org/wiki/Code_generator
JETGen
The JET Code Generator is a DataBase code generation system based on industry standard XSLT. If you've ever felt that you're writing the same data access code over and over again, this tool is for you!!
One of the most repetitive tasks that face enterprise java developers is the need to write a database access layer to interface with whatever backend RDBMS system is in use.
This task most often involves writing data classes that 'wrap' the schema of the tables, and a set of Factory/Manager classes that handle the storage and retrieval of these objects.
With the JET Code Generator, this task becomes trivial. In fact the process is so dependable and repeatable, it can actually be integrated into your build process. This can be especially useful early in the development cycle when the schema of the database changes often.
It uses the JDBC API to connect to your database, and export the schema as an XML formatted file.
Once the schema of the database in into an XML format, standard eXtensible Stylesheet Language Transformations (XSLTs) can be used to generate java code. That's right!, it's not just for presentation anymore!
It can be used to generate virtually anything that depends integrally upon your schema. Examples are presented for strait forward data access layer, but by writing custom XSLTs, the generator could be used to produce:
- Data Access Objects, and a persistence layer that changes automagically with your schema
- EJB Entity Beans
- FORM based Java Server Pages
- Simple Swing GUIs
The JET Code Generator comes with two complete examples based on a sample InstantDB database and the Northwind database included with the Microsoft Access database.
How is this different than the competition?
Most competing O/R mapping systems require the user (programmer) to be tightly integrated with the generation tools and classes. Often they will require that their 'middle layer' object caching system must used. They will require that your data classes or persistence layer will extend, and depend heavily upon their proprietary systems.
The JET Code Generator puts 100% of the control into your hands. Ultimatly, YOU write a set of template XSL Transformations, and have complete control over the resulting generatated code.
visit
JETGen
JETGen was visited : 162 times
Loading .....