A simple XSLT stylesheet that transforms a dia UML diagram into a series of java classes. This particular example transforms a UML diagram intended as a database schema ( in the style of dia2sql.pl ) into a family of java classes that implement a "Data Access Object" pattern. This includes a factory class, data access classes and data object classes.
Diax removes some of the tedium when generating java classes for database tables. However, it cannot do everything for you -- The implementation of the find(), insert(), delete(), update(), selectRS() and selectVO() methods is left for the user to fill in.
The inspiration for the this small project came from the dia2sql.pl project, which converts a dia UML diagram into DDL for either MySQL or Postgresql. See that project home page for more info.
I also looked at dia2code -- a very nice package, but I really want to generate specific design patterns from the UML. With the XSLT approach any kind of output is possible.
Additionally the "Data Access Object" pattern implemented by the stylesheet comes from the excellent book Core J2EE Patterns -- Best Practices and Design Strategies by Deepak Alur, John Crupi and Dan Malks. ISBN 0-13-064884-1 .
Diax is a simple XSLT transformer that takes a dia UML diagram as input and emits java class files as output.
The build mechanism requires the ant build tool from the Jakarta/Apache project. See the jakarta project for more info:
http://jakarta.apache.org/ant/
The download distribution is broken into two parts -- the JAVA source and the related Xerces and Xalan jar libraries. Download both tar files and untar them in the same directory.
To build the transformer cd into the top level source directory and type:
ant classes
To build the javadoc documentation type:
ant javadoc
The example sub-directory contains a sample dia UML diagram for a very simple database. To generate and compile the java class for the example type from the top level directory:
ant build-dro
Inspect the generated files in example/dro/*.java and compare to the dia UML diagram in example/test001_schema.dia .
The names of the java classes and packages can be configured using a properties files. See examples/diax.properties.
The XSLT stylesheet is src/dro/DiaGen.xsl -- customize this file to taylor the output for different purposes.
Copyrght (c) 2002. Curt Brune, curt@acm.org.
diax 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.
diax 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.
You should have received a copy of the GNU General Public License along with diax; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: README,v 1.1 2002/06/09 19:45:40 curt Exp $