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?
A:
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.
Reed Copsey
2009-08-22 17:04:26
You described the default behavior, but as I said on my answer you can turn "Show as association" on for those properties you want.
Alfred Myers
2009-08-22 17:06:56
A:
Habitat is a property in Being. They are not associated in the way the designer shows. The designer shows inheritance.
klabranche
2009-08-22 17:05:12
The designer will show you an association if you tell it to do so. See my answer.
Alfred Myers
2009-08-22 17:08:10
+2
A:
To show the property connection, right-click on the property; "show as association" or "show as collection association" (as appropriate)
Marc Gravell
2009-08-22 17:05:28
@Marc: You seem to run faster by foot than me on my bike (see my avatar) ;)
Alfred Myers
2009-08-22 17:10:09
+1
A:
It's off by default. Right click on the property and choose "Show as association"
Alfred Myers
2009-08-22 17:05:34