Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Volkan on June 19, 2016, 11:53:14 pm

Title: Does EA only generate a code template?
Post by: Volkan 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! ;) ;)
Title: Re: Does EA only generate a code template?
Post by: qwerty 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.
Title: Re: Does EA only generate a code template?
Post by: PeterHeintz 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).
Title: Re: Does EA only generate a code template?
Post by: Uffe on June 20, 2016, 06:34:56 pm
Hi Volkan,


Well, according to the help (http://sparxsystems.com/enterprise_architect_user_guide/12.1/software_engineering/code_generation_from_behaviora.html) 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 (https://www.youtube.com/watch?v=uEx5G-GOS1k)! :)


/Uffe
Title: Re: Does EA only generate a code template?
Post by: qwerty on June 20, 2016, 07:46:42 pm
Or visit us here (https://www.youtube.com/watch?v=Sv5iEK-IEzw)

q.
Title: Re: Does EA only generate a code template?
Post by: Volkan 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!
Title: Re: Does EA only generate a code template?
Post by: Volkan 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!
Title: Re: Does EA only generate a code template?
Post by: Volkan on June 20, 2016, 11:26:04 pm
Hi Volkan,


Well, according to the help (http://sparxsystems.com/enterprise_architect_user_guide/12.1/software_engineering/code_generation_from_behaviora.html) 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 (https://www.youtube.com/watch?v=uEx5G-GOS1k)! :)


/Uffe

Hi Uffe! Many thanks for the reply!
Title: Re: Does EA only generate a code template?
Post by: PeterHeintz 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.
Title: Re: Does EA only generate a code template?
Post by: qwerty 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.
Title: Re: Does EA only generate a code template?
Post by: Volkan 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! :-*