Merge code and model
This is only a EclipseUML 2008 feature which allows to:
- First work at modeling stage
- Then work at implementation stage without keeping live code and
model synchronization. (e.g. You can
close your UML editor)
- finally merge both model and java code in order to be able to go
back to the first modeling stage and have one more iteration
The merge option is an
important concept if the java project is evolving with the creation of
new UML diagrams.
The principle is too reverse the full project at the beginning of the
modeling stage, then to create diagrams and close EclipseUML.
After few weeks of coding another iteration stage is needed.
At this stage the model merge will add all detected new packages,
classifiers and connectors to the existing model.
The merge option is
available if you select the src >
Open / Reverse UML > Deep Reverse > Merge Model.
The merge mechanism is working at XMI level
and is respecting the following rules:
- Existing classifiers and connectors are never erased from
the model.
- Each
new package or classifiers are added to the model.
- Existing
Classifiers which doesn't exist anymore in the java code are
automatically transform into model classifiers and not deleted from
diagrams or from the model.
- Existing
classifiers which are refactored are also immediately renamed/moved in
the model and in each UML diagram when you first time open the editor.
- If
attributes or methods are added or deleted or rename then it is
immediately mapped with the model (e.g.
it means that deleted attributes or methods from the java code are
deleted from the model at this stage).
Please
note that if you copy and paste diagrams into another project
then diagrams will not anymore be synchronized with Java or the model.
If you
move diagrams inside your project then diagrams will keep the
same properties and will always be synchronized.