Book a Demo

Author Topic: Code Generation  (Read 4944 times)

Hans-Christian

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Code Generation
« on: August 15, 2007, 06:46:18 am »
Hi to all,

we are using EA quite a long time but only for creating diagrams (like class-, state-, sequencediagrams). Now I played a bit with the code generation functionality of EA.
Is it possible to generate code out of other types than classes ?
Is it be possible to generate code out of sequence or statediagrams directly or by using a (existing) third party product or an add-on ?

Thanks to your answers
Hans-Christian

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Code Generation
« Reply #1 on: August 15, 2007, 08:00:37 am »
Quote
Is it possible to generate code out of other types than classes ?
Is it be possible to generate code out of sequence or statediagrams directly or by using a (existing) third party product or an add-on ?

Hi Hans-Cristian,

The answer is yes and no...

You can do what you want with an add-in. There are a few examples floating around. Search this forum for a recent (over the last month or so) pointer to an add-in that does this for sequence (if I remember correctly) diagrams. [Be persistent in search, it can be tricky to get the results you want, but keep trying.]

You might have to use the examples you find as the nucleus for your own work, evolving them as you choose. If so, please consider contributing them to the EA Wiki if possible.

David

PS: There are limits to what EA will import, if you are reverse engineering something. You can probably do some decent work with an add-in here too, but the front end labor may be greater.
« Last Edit: August 15, 2007, 08:01:45 am by Midnight »
No, you can't have it!

Hans-Christian

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Code Generation
« Reply #2 on: August 15, 2007, 09:23:46 pm »
Hi David,

thanks for your fast answer. Does there exist some experiences for creating code out of EA ?
A collegue showed me for rhapsody the possibility to create code directly out of statediagrams by using Visual Studio. Does there exist a similar possibility for EA ?

Thanks for your answers
Hans-Christian

sl@sh

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Code Generation
« Reply #3 on: August 17, 2007, 12:58:37 am »
Rhapsody has this as a specific feature, and actually is capable to link it's diagrams to a running debugging session, so current states are being highlighted at runtime!

However, Rhapsody is also orders of magnitude more expensive than EA, so don't expect the same functionality ;)

It is possible to adjust EA's code generation facility to your own needs within certain limitations: check out the menu Settings --> Code generation Templates (or [Ctrl]-[Shift]-P) and you will find the code generation template editor, along with a list of already predefined templates.

You will find however, that when you try to generate a new template, you need to link it to objects like classes, associations, and the like - not states. So, you would need an AddOn of some kind that allows code generation for other kinds of objects. I have no idea if those exist, but maybe the above helps you in finding information.

Good Luck!

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Code Generation
« Reply #4 on: August 17, 2007, 09:14:32 am »
Also TAU allows "debugging" of model, but don't get it wrong, it has price, and not only in money. Modeling for this debugging is very meticulous and precise = a lot of had work on the little details. I'm not sure it suits all teams. I decided that in our case it's not worth the head ache...
Recursion definition:
If you don’t understand the definition read "Recursion definition".