SDE for Visual Studio 2005 "Update UML Model" problem

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.

thanks
Oren Shochat
Project Manager

Dear orenshochat,

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).

Best regards,
Rain

Hi Rain

This doesn’t seems to be the case.

  1. 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:

  1. The generalization arrow disappeared from the class diagram.
  2. The relationship vanished from the tree model properties.

One more thing: since I didn’t change the namespace the classes didn’t disappear from the class diagram, only the relationship was severed.

Anybody out there with an idea?

Hello orenshochat,

Sorry for keep you waiting. Our engineers are investigating this problem. We will keep you posted on this issue.

Best regards,
Jick

Hello orenshochat,

This problem is fixed. I just sent you an email about where to download the patch that contain the fix. Please check your mail box.

Best regards,
Jick

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.

Hello orenshochat,

Sorry but I am unable to reproduce the problem you have . Would you mind sending me your code? Thank you.

FYI below is the code I used the test the problem:


#pragma once

class SuperA
{
public:
	SuperA(void);
};


#pragma once

class SuperB
{
public:
	SuperB(void);
};


#pragma once
#include "supera.h"
#include "superb.h"

class SubClass :
public SuperA, public SuperB
{
public:
	SubClass(void);
};

Best regards,
Jick

The problem arises when I’m using Namespaces (I always do)

Try this:

namespace NSA
{
class SuperA
{
public:
SuperA(void);
};
} //NSA

namespace NSB
{
class SuperB
{
public:
SuperB(void);
};
} //NSB

namespace NSC
{
class SubClass :
public NSA::SuperA, public NSB::SuperB
{
public:
SubClass(void);
};
} // NSC

Thanks. I’ll test again and come back to you. :slight_smile:

hello orenshochat,

This issue should be fixed in the next release. I will inform you once it is out.

Best regards,
Jick

Hello orenshochat,

As I know build SP1 20070324, which contain the fix, is released. Please run the product updater to advance to this build.

Hope this helps.

Best regards,
Jick