The Ejen program is a text generation system ("text" means, including, but not limited to, source code in any kind of programming language). It makes use of Java/XML/XSLT technologies and is implemented for now as an Ant task. This implementation allows the setup of a complete generation, compilation and deployment sequence, by maintaining only one "build" file that indicates the order in which each of these actions must be achieved.
Generally speaking, Ejen should be understood as a system that organizes a data flow, whose initial source is an XML file containing a (minimal) set of data (required by the generation process). The data flow grows by the fusion with other XML files and by going through XSL "filters", until it is sufficiently detailed. It finally goes through XSL "templates" to produce the resulting text files.
A salient feature of this system is that it allows the use of almost any kind of text file as input, without the need of developing lengthy and complex Java extensions. The use of the JavaCC compiler compiler, when corresponding grammars ("Chomsky grammars") are provided, allows the transformation of those files into DOM tree representations. Resulting DOM trees may then be used in the generation process, as well as other native XML files.
Ejen is not therefore by itself a code generator. It is rather a system based on Java/XML/XSLT technologies that makes the actual creation of code generators easier and faster.
- The EJB 1.1 demonstration
A complete EJB 1.1 generation process (with test JSP files) has been written for the JBoss-[Jetty or Tomcat] server (using the HSQLDB database). This demonstration produces the entire set of Java source and XML files required by an Entity Beans (of "bean managed" type) deployment : the primary key classes, the home and remote interfaces, the complete implementation of the beans and the ejb-jar.xml deployment descriptor file. Basic JSP files, for testing purposes, are also generated in order to manage the EJB from an internet browser : database column creation/modification/destruction is managed this way, just as basic finding methods.
This demonstration has the following special feature : home and remote interfaces are deduced from a syntactical analysis of the generated bean. This feature allows the use of the generator not only to create the first EJB implementation, but also to synchronize (update) the dependent interfaces from a manual bean modification (for example, after the addition of a new and specific "findBy" method). As this system is open and flexible, this feature could be also used in order to synchronize other dependent classes (like client classes that encapsulate EJB calls).
- Licence (GPL)
Ejen (code generation system).
Copyright Â© 2001, 2002 FranÃ§ois Wolff (firstname.lastname@example.org).
Ejen is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Ejen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.