Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: g.makulik on November 23, 2012, 08:05:38 am

Title: C Gode Generation, handling private class elements
Post by: g.makulik on November 23, 2012, 08:05:38 am
Hi all,

IMHO the way EA renders certain UML elements to C-code representation (without using the OOP support option) is wrong:

I've tried to provide remedy on these flaws changing the standard C code generation templates, but failed so far.

Thoughts, opinions or workarounds anyone?

Best regards,
Günther


Title: Re: C Gode Generation, handling private class elem
Post by: g.makulik on November 27, 2012, 09:48:34 am
Bump

Doesn't really anyone have an opinion about this??

I know there must be a number of people around here that work with C language models and reverse engineering.

Regards,
Günther
Title: Re: C Gode Generation, handling private class elem
Post by: Helmut Ortmann on January 11, 2013, 01:52:02 am
Hi Günther,

I also stumbled about the problem and posted http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1357804524

I think about developing two scripts to handle the problem.

The ideas behind the two scripts are:

Generate:
Two or so changes in the template to handle extern, default, or so.

The idea behind it is:
The public attribute generates the *.h entry with EA standard
(extern, no default,..) generation.
The private attribute generates the *.c entry with EA standard generation.

Synchronize:

May be SPARX provide a solution.

I appreciate any suggestion.

Kind regards,

Helmut
Title: Re: C Gode Generation, handling private class elem
Post by: g.makulik on January 11, 2013, 08:06:01 am
Hi Helmut,

When I was bumping this question I've been expecting you (amongst others) to contribute to the discussion. Nice to see this had worked so far  8-).

I'm currently writing a guide for C/C++ code generation techniques and develop an MDG technology extension and AddIn to support workarounds for the EA standard's flaws.

Amongst other stuff I've come up with a (rough) solution for this particular problem. My approach is to

This approach has still some problems though with code synchronization (e.g. initialization values are lost in UML), and the overall project is far from being complete. Also I don't like the use of such macros, since they make the resulting code less readable/understandable.

UPDATE: Here are some discussions about alternatives (http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1357768899).

But I'm willing to give you the material I have so far and would appreciate having you to participate in this project (Just as reviewer, contributor, user or whatever is your preferred role). I'll send this to the eMail address you have published in your profile.

Best regards,
Günther