Author Topic: Usage of Code Template Framework?  (Read 3559 times)

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Usage of Code Template Framework?
« on: March 27, 2008, 04:25:50 pm »
Hi,
Can CTF be applied to elements other than class. Can it be applied to elements like Activity,Region,Parameter. Because in the documentation I couldn't find much related to this.
Regards,
Thiyagaraj A.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Usage of Code Template Framework?
« Reply #1 on: March 27, 2008, 09:09:52 pm »
Hi,


There does seem to be a bit of magic involved in the CTF and the documentation isn't all it could be. What it boils down to is essentially that code can only be generated for such entities as you find in Class diagrams.

The basic unit of code generation is the Class (and you may for instance find that a classless package behaves in a way you weren't expecting).
In the CTF Editor, if you click the "Add New Custom Template" button the drop-down "Template Type" lists the UML entities to which code generation templates may be associated. Activity and Region aren't in it.

Parameters, however, are OK - within methods within classes, that is. Activity Parameters, which I assume are what you're after, no can do.

In other words, EA can generate only code stubs, no actual method guts. So if you're trying to do what I think you're trying to do, get it to generate implementation code from Activity or State diagrams, then it can't be done.

... using the CTF.

A Model Transform would also be unable to hook into things like Activities, although a transform template is able to create such entities.

Leaves the Automation Interface, but I couldn't say how to go about it.


/Uffe
My theories are always correct, just apply them to the right reality.

Thiyagaraj A

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Usage of Code Template Framework?
« Reply #2 on: March 28, 2008, 03:20:45 pm »
I think the only way is the automation Interface. Thanks Uffe.
Regards,
Thiyagaraj A.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8064
  • Karma: +118/-20
    • View Profile
Re: Usage of Code Template Framework?
« Reply #3 on: April 01, 2008, 08:18:31 am »
Quote
A Model Transform would also be unable to hook into things like Activities, although a transform template is able to create such entities.
Model transformation can actually access all object and connector types within EA.  There are still limitations, to get around these it is effective to have an addin and call EXEC_ADD_IN.  (Many examples given in other posts)