Book a Demo

Author Topic: Does EA only generate a code template?  (Read 11459 times)

Volkan

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Does EA only generate a code template?
« on: June 19, 2016, 11:53:14 pm »
Hi! I am a beginner in learning EA system engineering edition.

I just watched a introduction on generating HDL code based State Machine model. The example used in that introduction is Portable Audio Player.
I read the VHDL code generated carefully and discovered that the code is only a template without doing any actual computation. You have add the computation to the code template to complete the implementation. Does it mean that EA only generate a code template? Is it possible to generate a code including the actual computation part using EA?

Thank you in advance! ;) ;)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Does EA only generate a code template?
« Reply #1 on: June 20, 2016, 04:07:17 am »
EA will only generate the class framework (properties, getters, setters and if you habe the right license code for state machines). You can put code in the behavior property of a class and it will appear in the generated code, but round tripping with that will not really work. I once used RR for code gen. They put hooks in the generated code and round tripping was - so to say - possible. But no real fun. From my POV this procedure with EA is even less fun. But up to creating code EA is a very nice tool. My 5 cents.

q.

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Does EA only generate a code template?
« Reply #2 on: June 20, 2016, 06:26:04 pm »
To make a "come out" here, I do not use EA code generation at all, even not to generate the “code framework” (what would work fine from my experience). If I need code level stuff in my model I go the other direction (“reverse engineering”).
Even if generation of algorithm would be possible/good, I would not use that feature because I belief that specifying algorithms to a level of detail that code can be generated is much more effort with UML than writing the code. Further on you have to know what code the code generator generates from your model, what makes the issue quiet complex.
For me UML is a specification language rather than a programming language.
I do not say that code needs to be always written in a text editor (for control functions there exist several good graphical programming environments) but UML for me is not a graphical programming language at all (at least not as long as somebody do not only show me that doing so is not only somehow possible but making sense).
Best regards,

Peter Heintz

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Does EA only generate a code template?
« Reply #3 on: June 20, 2016, 06:34:56 pm »
Hi Volkan,


Well, according to the help it is possible to get code from behavioral models, but if what's described there is any different from, or any improvement on, what's shown in the tutorial I couldn't say.

Personally, I think generating source code from UML models is a fool's errand because UML is a rubbish programming language. So on this topic I'm sitting with qwerty and Peter over here in Camp Curmudgeon. You should come visist! We've got a flag! :)


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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Does EA only generate a code template?
« Reply #4 on: June 20, 2016, 07:46:42 pm »
Or visit us here

q.

Volkan

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Does EA only generate a code template?
« Reply #5 on: June 20, 2016, 11:07:04 pm »
EA will only generate the class framework (properties, getters, setters and if you habe the right license code for state machines). You can put code in the behavior property of a class and it will appear in the generated code, but round tripping with that will not really work. I once used RR for code gen. They put hooks in the generated code and round tripping was - so to say - possible. But no real fun. From my POV this procedure with EA is even less fun. But up to creating code EA is a very nice tool. My 5 cents.

q.

Hi qwerty! Thank you very much for the nice reply! Could you please explain a little bit more on " the behavior property of a class"? Because when I right click on a class and select properties, there is no option as behavior property. Thank you again!

Volkan

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Does EA only generate a code template?
« Reply #6 on: June 20, 2016, 11:25:08 pm »
To make a "come out" here, I do not use EA code generation at all, even not to generate the “code framework” (what would work fine from my experience). If I need code level stuff in my model I go the other direction (“reverse engineering”).
Even if generation of algorithm would be possible/good, I would not use that feature because I belief that specifying algorithms to a level of detail that code can be generated is much more effort with UML than writing the code. Further on you have to know what code the code generator generates from your model, what makes the issue quiet complex.
For me UML is a specification language rather than a programming language.
I do not say that code needs to be always written in a text editor (for control functions there exist several good graphical programming environments) but UML for me is not a graphical programming language at all (at least not as long as somebody do not only show me that doing so is not only somehow possible but making sense).
Hi Peter! Thank you very much for the advice! I really appreciate that!

Volkan

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Does EA only generate a code template?
« Reply #7 on: June 20, 2016, 11:26:04 pm »
Hi Volkan,


Well, according to the help it is possible to get code from behavioral models, but if what's described there is any different from, or any improvement on, what's shown in the tutorial I couldn't say.

Personally, I think generating source code from UML models is a fool's errand because UML is a rubbish programming language. So on this topic I'm sitting with qwerty and Peter over here in Camp Curmudgeon. You should come visist! We've got a flag! :)


/Uffe

Hi Uffe! Many thanks for the reply!

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Does EA only generate a code template?
« Reply #8 on: June 21, 2016, 02:00:01 am »
I had the feeling that most people in the forum do not extensively use EA to generate code.

But I admit, that I had some fears that some people firing posts to me after my clear statement.
Best regards,

Peter Heintz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Does EA only generate a code template?
« Reply #9 on: June 21, 2016, 06:07:00 am »
- Open the properties of an operation
- Lower right you see tabs: Parameter, Notes, Behavior, ...

There you are :-)

q.

Volkan

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Does EA only generate a code template?
« Reply #10 on: June 21, 2016, 04:43:05 pm »
- Open the properties of an operation
- Lower right you see tabs: Parameter, Notes, Behavior, ...

There you are :-)

q.

Hi qwerty! Thank you! It is very nice of you! :-*