Finally we have a solution to our Java class generation issues. I
decided to go ahead and start Velocity-based implementation. It turned
out to be simpler then I thought.
I already have ClassGenerator implemented. There will be one more class
- MapClassGenerator that will use ClassGenerator to walk through a map
and create Java classes for each ObjEntity. This one will need hooks to
Misha's GUI, so that for each Java class being generated, a user can
specify location and also policy like "overwrite", etc.
Also we will need a tool similar to eogenerator (known to WebObjects
people only). Basically this is a class generator (based on the code
described above) that can be integrated into the build process. I can
see this as a custom Ant task.
Now I am working on default templates located at
cayenne/src/templates/dotemplates (for Velocity template syntax see
http://jakarta.apache.org/velocity/user-guide.html )
Note that I bundled Velocity with Cayenne, so that by default no extra
software is needed. This slows down build process by ~5 sec on my
machine (since it unjars velocity, and then jars it back together with
cayenne). Alternative Ant target that does not bundle Velocity is
"jar-nodeps", but build.xml may require more work in this direction.
I will post an update when templates are finished and can be used to do
class generation.
-- ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- - Andrei (a.k.a. Andrus) Adamchik http://objectstyle.org email: andrus at objectstyle dot org
This archive was generated by hypermail 2.0.0 : Tue Feb 26 2002 - 19:08:28 EST