Book a Demo

Author Topic: MDA transforms and connectors  (Read 2391 times)

Thomas_Arnbjerg

  • EA User
  • **
  • Posts: 80
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
MDA transforms and connectors
« on: August 23, 2007, 12:09:14 am »
Hi all.

Two other newbie questions:

Background:
I have drawn a component diagram with one component ("Component1") with two exposed interfaces ("I1" and "I2"). I've written a MDA transform, which generates a new model, where a package named after the component is created (i.e. "Component1"). A lot of interconnected component related framework classes are added to this package, among others a class "ServiceManager". For each of the exposed interfaces in the original model a child package to the component package is generated bearing the name of the relevant interface (using the transformation template "InnerClass"). A lot of interface specific classes are added to each interface specific child package, among others an interface element bearing the name of the exposed interfaces (i.e. "I1" and "I2").

1) I would like to create a connector (e.g. a dependency) between the component specific "ServiceManager" class and the interface objects "I1" and "I2" in the interface specific packages. Does anyone know if that is possible (and how)?

2) I would like to add a reference from the generated component related diagram to each of the interface specific diagrams (as if i drag a diagram from the project browser and drops it on a diagram ). Does anyone know if that is possible (and how)?


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDA transforms and connectors
« Reply #1 on: August 23, 2007, 04:26:37 pm »
If you're wanting to do something like what I'm thinking then you can do it.  It just requires something a little different.  I'll give you another example and hope you can apply it to your specifics.

Code: [Select]
%if elemType=="Component"%
Package
{
 name=%qt%%className%%qt%
 Class
 {
   %TRANSFORM_REFERENCE("ServiceManager")%
   name=%qt%%className%ServiceManager%qt%
 }
$var=%list="InnerClass" @separator="\n" @indent="  "%
%REPLACE($var, "<parentComponent>", classGUID);
}
%else%
Class
{
 %TRANSFORM_REFERENCE("Class")%
 name=%qt%%className%%qt%
}
Dependency
{
 Source { %TRANSFORM_REFERENCE("Class")% }
 Target { %TRANSFORM_REFERENCE("ServiceManager", "<parentComponent>")% }
}
%endIf%