Question

Assume that class Being has a property of type Habitat. Both classes are implemented in their own .cs files. When I drag and drop the two classes from the class designer onto a new Class diagram, I do not see an association line from Being to Habitat, whereas there is an association in code. Am I doing something wrong, or this simply isn't implemented in VS yet?

Was it helpful?

Solution

To show the property connection, right-click on the property; "show as association" or "show as collection association" (as appropriate)

OTHER TIPS

It's off by default. Right click on the property and choose "Show as association"

The class diagram doesn't show "lines" between every instance (property) of a type and its type. This would get very, very messy very quickly.

If "Being" derived from "Habitat" (which wouldn't make sense), it would show a line for that. It shows lines for inheritance, not each individual field/property.

Habitat is a property in Being. They are not associated in the way the designer shows. The designer shows inheritance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top