On Nov 15, 2007, at 3:08 PM, Mike Schrag wrote:
>> I'd like the ability to generate code for individual attributes and
>> relationships without having to regenerate the whole class file.
>>
>> In the context menu for a .java file, under source, you have
>> options to override, implement and generate all sorts of things.
>> I'd like to be able to genarate EO code from there - and of course
>> from within the entity modeler.
>>
>> Don't feel I need an EOGenerator replacement at all.
> You can log a request for this, but at the moment, EOGenerator is
> the way code generation will work for the foreseeable future. It's
> only regenerating "read only" classes, so this really should not be
> a problem, and in fact more recent builds of the velocity generator
> only rewrite _Files whose MD5 sums are different than what's already
> on disk. The richness you can get out of code generation with
> EOGenerator is just so much greater than what you would be able to
> do with code generation in the editor, not to mention that you
> really want standardized code generation across all of your
> entities, which means you would be going into the editor and
> generating code for each every time. One of the nice features of
> the generation gap pattern is that you just don't have to think
> about the problem of /** GENERATED CODE HERE DON'T EDIT **/ blocks
> like in many of the other styles of generation.
Personally, I'm happy with the whole "rebuild everything" model, so I
agree in general but if Velocity supports "#include", this could be
done by factoring the templates into stuff for an attribute and stuff
for a relationship. i.e.:
foreach attribute:
include _attribute.java
But that's probably over-engineering. About the only time I would ever
use the "just build me one attribute worth of code" thing is when I
want the "super classes implementation plus a little bit of salt".
Probably not necessary really.
Pierce
This archive was generated by hypermail 2.0.0 : Thu Nov 15 2007 - 17:22:47 EST