David, On Thursday 26 June 2003 14:58, David Wann wrote: > I see what you are saying about the comments in generated classes. > > Regarding the naming convention for missing role names, here is a > snippet from my VSL: > > #set ($targetrolename = $adata.target.roleName) > #if ($targetrolename == "The$adata.target.type.name") > #set ($targetrolename = $adata.target.type.name) > #end > #set ($sourcerolename = $adata.source.roleName) > #if ($sourcerolename == "The$adata.source.type.name") > #set ($sourcerolename = $adata.source.type.name) > #end > > I know it is making a big assumption, but I think it's reasonable.
Yes, probably. But see below... > On the rare occasion that a class name starts with "The", you could set the > role name. Well, that's exactly the problem here - how do I recognize in the template that "TheWhatever" isn't the role name that has been explicitly specified in the model? As far as I can see, I can only use the guesswork from above - with the consequence that strange things happen if you decide to name your relation role "TheWhatever". Probably not very likely that someone wants to do this, but if it happens, you can bet on that particular user wasting a lot of time figuring out why relation target names get mangled in some strange way. And that is something I want to avoid at almost any cost - after all, AndroMDA should make life easier for the developer, not harder :-) > Probably the best way though is to change the java code (it > isn't done in the XMI.) I haven't found where it is done yet. Yes, either change the code to return null or an empty string (may break other functionality, though) or better provide some means to reliably check if the name has been explicitly specified or not. Unfortunately, I have not that much spare time available right now, and this feature is low on my own priority list because I always explicitly name the relation targets in the model :-) Do you want to take a stab at it? Regards, 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, [EMAIL PROTECTED]
pgp00000.pgp
Description: signature
