I’m using an evaluation of visual paradigm SDE version 4.0 Build 20070220.
Using “Update To Code” and then Back to UML model. When I don’t use packages everything looks fine. Once I start using packges and generates code using “Update to code” option I get a class within a namespace (works fine). However, once I have a Namespace and I use “Update UML Model” (without even changing the code), the UML Classes lose their relations (Generalization arrow disappears from the diagram).
This looks like basic stuff, so I wonder if there is a patch to solve this issue.
I’m sorry that this is the default behavior in SDE. Because we have to keep the code and diagram in sync, when you change the package/namespace in code and update UML model, then we will remove the shape from the diagram (since the diagram is already incorrect). But this doesn’t means we have removed your model. When you switch to model tree, you will see the class model and relationships still here (you can right click on diagram tree and select Show Relationship to show up the relationships).
I didn’t change the code. What I did is described in the following set of actions:
a. Opened a new package (Family).
b. Added a Class Parent and Class Child.
c. Added an empty class diagram, dragged the parent and child classes to it and created a generalization arrow from Parent to child.
d. The relationship tab in the child class properties showed the new relationship.
e. I generated code for the package using “Update To Code” option.
f. The header files created looked fine for both classes (including namespace and inheritance).
g. Without changing a single character in the code I used the “Update UML Model” on the project.
The result:
The generalization arrow disappeared from the class diagram.
The relationship vanished from the tree model properties.
The patch works fine, however. Multiple inheritance I.e. Generalization from multiple parents doesn’t seem to work.
If a class inherits from 2 superclass then only one generalization is implemented in the UML diagram, contradictory to the C++ code.