Sparx Systems Forum
Enterprise Architect => General Board => Topic started 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! ;) ;)
-
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.
-
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 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
-
Or visit us here (https://www.youtube.com/watch?v=Sv5iEK-IEzw)
q.
-
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!
-
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!
-
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!
-
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.
-
- Open the properties of an operation
- Lower right you see tabs: Parameter, Notes, Behavior, ...
There you are :-)
q.
-
- 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! :-*