Synchronization Tips

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Projects and Code Engineering > Synchronizing the Model and Source Code >

Synchronization Tips

Renaming of classifiers and reverse engineering

The process described below applies to the standalone application as well as to the plug-in versions (Visual Studio or Eclipse) when reverse engineering or automatic synchronization takes place.

 

Renaming a classifier in the code window of your programming application causes it to be deleted and re-inserted as new classifier in the Model Tree.

 

The new classifier is only re-inserted in those modeling diagrams that are automatically created during the reverse-engineering process, or when generating a diagram using the Show in new Diagram | Content option. The new classifier is inserted at a default position on the diagram, that will likely differ from the previous location.

 

See also Refactoring code and synchronization.

 

Automatic generation of ComponentRealizations

UModel is capable of automatically generating ComponentRealizations during the code engineering process. ComponentRealizations are only generated where it is absolutely clear to which component a class should be assigned:

 

Only one Visual Studio project file exists in the .ump project.
Multiple Visual Studio projects exist but their classes are completely separate in the model.

 

 

To enable automatic generation of ComponentRealizations:

1.Open the menu item Tool | Options.
2.Click the Code Engineering tab and activate the Generate missing ComponentRealizations option.

 

Automatic ComponentRealizations are created for a Classifier that can be assigned one (and only one) Component

 

without any ComponentRealizations, or
contained in a code language namespace.

 

The way the Component is found differs for the two cases.

 

Component representing a code project file (property "projectfile" set)

 

if there is ONE Component having/realizing classifiers in the containing package
if there is ONE Component having/realizing classifiers in a subpackage of the containing package (top down)
if there is ONE Component having/realizing classifiers in one of the parent packages (bottom up)
if there is ONE Component having/realizing classifiers in a subpackage of one of the parent packages (top down)

 

Component representing a directory (property "directory" set)

 

if there is ONE Component having/realizing classifiers in the containing package
if there is ONE Component having/realizing classifiers in one of the parent packages (bottom up)

 

Notes:

 

The option "Code Engineering | Generate missing ComponentRealizations" has to be set.
As soon as ONE viable Component is found during one of the above steps, this Component is used and the remaining steps are ignored.

 

Error/Warnings:

 

If no viable Component was found, a warning is generated (message log)
If more than one viable Component was found, an error is generated (message log)

© 2019 Altova GmbH