|Re: Can it has bidirectionl sychronization? [message #1004569 is a reply to message #1004565]
||Wed, 23 January 2013 13:25
| Ed Merks
Registered: July 2009
No, there's no automatic reverse engineering from generated code to the
Ecore model. But, if you define your model with Xcore, you can refactor
the "name" feature in the Xcore source and it will invoke Java
refactoring on the generated code and that refactoring will also rename
all the hand written uses of all the renamed things, including the use
of constants in the generated package. Xcore supports refactoring of
all named elements.
If you don't use Xcore, you should refactor your Java code to rename the
getter and setter (that's important only if you have hand written code
that uses the old name), rename the feature in Ecore, and then
regenerate the model.
On 23/01/2013 2:14 PM, Lucy Chan wrote:
> Assume we use the EMF to model a simple class diagram. It has a class
> named "Example" with an attribute named "name" which is EString type.
> name: EString
> With EMF, we will generate methods "setName()" and "getName()" in the
> code template Example.java.
> I just wonder if I change methods "setName()" and "getName()" to
> "setDescription()" and "getDescription()", can the ecore model will
> change the attribute name from "name" to "description" automatically?
> Thanks for your attention.
> Best Regards,
> Lucy Chan
Powered by FUDForum
. Page generated in 0.03188 seconds