Matthias,

  I wrote 2 question, answered by you today.
  
  I know AndroMDA a bit, so I was expecting exactly the answers you
give me. If someone do not know what messages I am talking about
please look on the list history on a message with subject "How to
creare a session bean to every entity bean ?".

  IMHO they show a problem with AndroMDA.

  I think write a templete (or edit it) must not be the solution to
these problems. This must be treated in one another level of abstraction.
More specifically in the level of the model. To this AndroMDA must
have the concept of transformations.

  So the tool must read the UML model and this model will be processed
by some transformations generating a new model. The model will run
over a transformation chain, until become the final model. This final
model will then be processed by templates to generate the source code.

  To make this clear this is a example of how I can create a
transformation to insert a PK field on each entity bean :

public class CreatePkFieldsTransformation extends MdaTransformation {

        public void run(Model model) {
                Klass[] klasses = model.getClasses().getClazz();
                for (int ct=0;ct<klasses.length;ct++) {
                        Klass klass = klasses[ct];
                        
                        if ("EntityBean".equals(klass.getStereotype())) {
                                Attribute attrNew = new Attribute();
                                attrNew.setName("id"+getFirstUpper(klass.getName()));
                                attrNew.setType("java.lang.Long");
                                attrNew.setIsPrimaryKey(true);
                                klass.getAttributes().addAttribute(0,attrNew);
                        }
                }       
        }

}

  I think this solution is much better than edit the template. Because
it isolate the problem on a simple class. And I do not to confuse my
templates with this kind of detail.

  Template must be only used to make the final transformation from model into
code source.

  The code sample of primary key addition is from a MDA tool I am
doing myself. But I think it is a waste of my time to develop, if
AndroMDA can do something like this.

  What do you think ?

-- 
Best regards,
 Danilo                            mailto:[EMAIL PROTECTED]




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to