Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: zalbina on January 24, 2013, 10:09:41 pm
-
Hello,
Yes, when I'm doing reverse engineering from my java code into EA can I, somehow, intervent to this process in the middle? How does EA perform this operation? Does it use some template and where can I find it?
Thanks.
-
One way to intercept the process of reverse engineering/code synchronization is to provide an MDG AddIn and use the related MDG events. I'm currently experimenting with this myself, but at a very early stage yet.
You can also provide BNF like language descriptions that map to certain UML elements from an AST generated during the parsing process. But AFAIK it's not possible to extend of intercept this for existing built in languages.
HTH
Günther
-
WOW, such a fast answer :)! So, I guess, your second option is not the option at all and I have to stick with the first one.
We just have an issue with getters and setters which I've added to the Java Code Generation template. When I generate java code from EA I have very nice code actually, but after reverse engineering and code generation again I have double getters and setters declaration. So, if I repeat this action 5 times I have 5 * getters and 5* setters :-[.
Thanks.
-
So what I plan to do with my MDG AddIn is to solve a similar situation: I have excess duplicate attributes reverse engineered from my generated C code.
The idea was/is to handle the MDG_Merge (http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/mdgadd_insmerge.html) and MDG_PostMerge (http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/automation/mdgadd_insmdgpostmerge.html) events and remove the excess stuff from the model onwards.
But may be for your problem there exists a simpler solution. I remember you can control how EA handles properties and auto-generated get/set methods. I'd guess EA should be able to handle these consistently on reverse engineering (Have a look at Tools->Options->Code Engineering and ->Java).
Best regards,
Günther