On Thursday 02 October 2003 16:31, Sanche, Neal wrote: > Hi Richard, > > I'm quite happy there's someone else out there that sees things like I do. > > > Here's a couple more advantages of using delegation for the > > *Impl classes: > > > > - If we don't need an *Impl class (i.e. if there are no > > business methods that need to be handcoded), we don't > > generate them. This has the potential to > > eliminate a lot of bloat, since for the vast majority of > > <<Entity>> classes there is no real need for an *Impl class. > > That is definitely a worthwhile advantage. It would be easily done in the > <<Entity>> classes, but is there a way to have the AndroMDA generator skip > generation of certain classes based on certain criteria? For example, if > there are no business methods declared on an Entity, skip the generation of > a Delegate interface and delegate concrete class. I haven't seen this > functionality yet. Anyone know?
Yep. I've implemented it a while ago :-) Simply set the "generateEmptyFiles" attribute of the <template> element cartridge.xml to "false", and make sure that your template does not produce any output for files that you don't want to generate (i.e. enclose the whole template with an appropriate "#if() .. #end"). AndroMDA takes care of the rest. For an example, look at the generation of local/remote interfaces for session beans in the andromda-ejb cartridge. Happy hacking, Richard -- Richard Kunze [ t]ivano Software, Bahnhofstr. 18, 63263 Neu-Isenburg Tel.: +49 6102 80 99 07 - 0, Fax.: +49 6102 80 99 07 - 1 http://www.tivano.de
pgp00000.pgp
Description: signature
