Hi,

I have a suggestion for IMHO an improvement of the current AndroMDA sources.

First of all I think the UML Profile (stereotypes and tagged values) should
be declared formally. For the project I am working on we did this by
declaring a static class with only constants and using reflection to return
a HashMap with all constants in that class. This HashMap can be accessed
from the $transform object using the getProfile() method.
Big advantage of this approach is that you can use the constants from your
Velocity scripts by accessing the HashTable which will avoid a lot of typo
errors in the scripts. Velocity will warn you about Constants you use from
you script that are not in the HashTable since they will result in a compare
using a null value.
For example, in the following script I test if the attribute stereotype is
set to "required":

#if ($attributeStereoType ==
$transform.profile.STEREOTYPE_ATTRIBUTE_REQUIRED )

I use the getProfile() method on the Helper class that returns a HashMap
with all constants. In case of a typo, Velocity will generate an error,
which would never occur if the test would have been on a hardcoded string.
Actually I'm not sure if a class with constants would be the best way to
model the AndroMDA UML profile so I would love to hear some feedback on
this. If you are interested in this approach, I'll submit my current
implementation as a Patch .

cheers,

Rudie Ekkelenkamp

Finalist IT Group
Java Specialists
-------------------------------------------------------------
Amsterdam, The Netherlands                          
Office:         +31 10 217 08 00
Fax:          +31 10 280 96 20
Web:          http://finalist.com
------------------------------------------------------------- 
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
-------------------------------------------------------------
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Andromda-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to