Hi Danilo, aha, caught me ... now I know why I felt a little uneasy answering your questions today! My architectural intuition warned me when I pressed the "send" button of my email system but it was too late. :-)
MDA model transformations (PIM-to-PIM or PIM-to-PSM) are not yet supported by AndroMDA. However, the OMG already proposes them and now you have shown two very nice and simple examples for them, it's easy to see that transformations have an advantage over "simple brute template force". :-) I think, this would be an excellent feature for AndroMDA 3.x, the new version that will be developed after 2.x has gone final (see my email "Short term plans and long term plans", Sunday July 13, 2003). If you want, you should join forces with the AndroMDA developer team and bring this feature into AndroMDA. I see a good chance that it fits into the architecture quite easily, some minor improvements to the existing cartridge system would have to be made. You talked about an MDA tool that you're writing. Is it open source or closed source? If it's open, we should definitely join forces and centralize the features in one tool (AndroMDA) instead of writing several (possibly incompatible) tools. If it's close source, we do not have any chance. What do you think, Danilo? Cheers... Matthias > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Danilo Luiz Rheinheimer > Sent: Sunday, July 20, 2003 9:46 PM > To: [EMAIL PROTECTED] > Subject: [Andromda-user] Transformations on AndroMDA > > > 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 > ------------------------------------------------------- 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
