Problem with associations

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

I have 2 classes, A and B. In the A class, I've created an attribute of type
B(): private b = new B();
In other words, I have an association from A to B.

The problem occurs when I export the project to Visio-UML because doesn't
export the association.
Does anybody know why?
Thank you very much.
 
Alberto,

In .NET, this is not an attribute, but rather, a field. Attribute has a
specific meaning in .NET, different from how you are presenting it here.

Chances are that it is not being exposed in UML because it is private.
It doesn't affect the public interface of A, which is why it doesn't show
up. Expose it as public (either change the field to public, or expose a
public property which returns the value), and it should show up.
 
Anyway, I've created the association with the object designer of visual
studio and it created the public property. After that, I've exported it to
visio and the association didn't appear.
Thank you.

Nicholas Paldino said:
Alberto,

In .NET, this is not an attribute, but rather, a field. Attribute has
a specific meaning in .NET, different from how you are presenting it here.

Chances are that it is not being exposed in UML because it is private.
It doesn't affect the public interface of A, which is why it doesn't show
up. Expose it as public (either change the field to public, or expose a
public property which returns the value), and it should show up.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alberto said:
I have 2 classes, A and B. In the A class, I've created an attribute of
type B(): private b = new B();
In other words, I have an association from A to B.

The problem occurs when I export the project to Visio-UML because doesn't
export the association.
Does anybody know why?
Thank you very much.
 
Back
Top