Synchronization between code and model

I create a class diagram and then generate their code by Visual Paradigm.
I have inserted a lot of code into generated classes and now I need to update the model. but I would like to perform updating through Visual Paradigm for easiness.
if I update my model and then generate classes and replace them on current classes I will lose my codes.
how could I insert my code in the model to keep and maintain them after generating classes code in the model?
I could update classes and then update the model by them, but updating in the model is more simple and I want to update my model first and then update my classes based on new model and keep classes implementation codes as well.

Hi Hamed,

Thank you for your post. To keep the implementation during code/model updating, please try our round-trip engineering feature.

To generate/update code from model, select Tools > Generate Java Code… To reverse/update model from code, select Tools > Code > Reverse Java Code…

As said, it’s the round-trip way of code and model updating, meaning that changes will be merged, instead of overwriting. You can perform round-trip for Java and C++.

Finally, don’t mix up with “Instant Generator” and “Instant Reverse”. While they both can handle code generation and reversal, they are aimed for producing an “instant”. The target will be overwritten upon execution.

Hope the information has helped. Please feel free to contact us if you have further inquiries.

Best regards,
Jick Yeung

yes, you are right.
changes will be merged.
thank you

You are welcome. :slight_smile: