EOGenerator (an awesome tool!)
EOGenerator
is a powerful tool and worthwhile incorporating. I just did for the first time
on a new project. While it is fresh in my mind I put together a quick start
guide....
EOGenerator
is freeware from the great folks at Rubicode . In a nutshell,
it saves you time and energy because if you you use it, you will have to write
less java code. It implements the Generation Gap
Design pattern for your EOModel's
entities.Practical WebObjects
recommends it. David
LeBer recommends it. Jonathon "Wolf" Rentzsch at rentzsch recommends
it.Download it, expand it. I used
Jonathon's templates as a basis for mine. Available here (Thanks Jonanthon)
....http://rentzsch.com/share/eogenerator52templates.zip
Some notes on Jon's templates that can
be fixed if you learn MiscMerge and update the templates (but until then,
manually fix these in generated code). Also these are only an issue in the case
of inheritance hierarchies:- The subclass
for abstract entities is not abstract itself and it should
be- Base classes get a "localInstance"
method which throws a compile error on the subclasses because the return types
are different signature.To quickstart,
use David LeBer's command line
arguments as a guide.On my
Powerbook, I copied eogenerator executable to /usr/bin (to save me having to
modify my class paths yet again or to save me having to type long path-based
commands!). My command looked something like this for my current
project:eogenerator -model
/Users/kieran/DevProjects/Cheetah/Code/cheetah/cheetah.eomodeld -destination
/Users/kieran/DevProjects/Cheetah/Code/cheetah -subclassDestination
/Users/kieran/DevProjects/Cheetah/Code/cheetah -templatedir
/Users/kieran/Applications/EOGenerator/MyTemplates -javaTemplate
JavaSourceEOF52.eotemplate -subclassJavaTemplate
JavaSubclassSourceEOF5.eotemplate -verbose
-javaAfter gnerating the java files,
simply add the all to the classes category of your XCode project (if you use
XCode)
Posted: Sunday - November 14, 2004 at 10:00 AM