Book a Demo

Author Topic: How does it the proper way to generate 2 or more classes in mode transformation?  (Read 2884 times)

mgodoy-br

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Good evening, MDG fellows

I'm a EA user and MDD enthusiastic for long time. I'm trying to migrate to MDA approach through MDG Technology in order to draw M2M transformation from PIM to PSM. I've created the profile and stereotype bound to metaclass. To model transformation, I've used the transform template, that is quite similar to code generation which am I knew already.

So, my intention is make each class that use my stereotype be capable of generate two or more classes in order to achieve my little pattern.

I've created a Transformation Type based on C# and overriden my stereotype over Class template. So, inside of it, I've copied "%elemType%" and all that default code.

My question is: how is the proper way to program my template to generate two classes? I just put a new Class element below that default code. I've achieved my purpose, but, am I right? How do you guys use to do that?

Thanks a lot.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
The trick is changing the TRANSFORM_REFERENCE for at least one.

eg.
Code: [Select]
Class
{
  %TRANSFORM_REFERENCE("Class")%
  %TRANSFORM_CURRENT()%
}
Interface
{
  %TRANSFORM_REFERENCE("Interface")%
  %TRANSFORM_CURRENT()%
}
Realization
{
  %TRANSFORM_REFERENCE("Realization")%
  Source{
    %TRANSFORM_REFERENCE("Class")%
  }
  Target {
    %TRANSFORM_REFERENCE("Interface")%
  }
}

mgodoy-br

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Thank you very much! Now I can see that am I in the right path!  :D :D

Another question: there some document where I can query for MDG tag transformation? I'd like to study it.