Dependency Relationship in CLASS Diagram
- Is there a way to add a dependency relationship on a CLASS Diagram.
Answers
Hi JBLENNON,
That depends on which CLASS diagram you are referring to.
For VS 2008 (and 2005 I think) the only class diagram is the one that is available on code projects by right clicking the project in Solution Explorer and selecting "View Class Diagram". Within this diagram you can create a relationship between two classes which creates a property on the source class of a type of the second class. This is the closest thing that this class diagram has and it isn't what is usually meant when thinking of dependancies in the UML sense.
With VS 2010 there is still the same class diagram as described above but there is also a UML Class diagram available as part of a modeling project. This diagram is does have the ability to define a true dependency relationship between two classes as defined by the UML Specification along with Association, Aggregation, Composition and Inheritance. However there currently isn't any code generation available from this type of diagram. Given a dependency as defined in the UML spec how that would be realized in code could be very different from one interpretation to another as the Dependancy is the weakest type of relationship and doesn't really indicate a concrete relationship of a given type.
I hope that helps.
Larry
- Marked As Answer byEdwer FangMSFT, ModeratorTuesday, November 03, 2009 3:31 AM
All Replies
Hi JBLENNON,
That depends on which CLASS diagram you are referring to.
For VS 2008 (and 2005 I think) the only class diagram is the one that is available on code projects by right clicking the project in Solution Explorer and selecting "View Class Diagram". Within this diagram you can create a relationship between two classes which creates a property on the source class of a type of the second class. This is the closest thing that this class diagram has and it isn't what is usually meant when thinking of dependancies in the UML sense.
With VS 2010 there is still the same class diagram as described above but there is also a UML Class diagram available as part of a modeling project. This diagram is does have the ability to define a true dependency relationship between two classes as defined by the UML Specification along with Association, Aggregation, Composition and Inheritance. However there currently isn't any code generation available from this type of diagram. Given a dependency as defined in the UML spec how that would be realized in code could be very different from one interpretation to another as the Dependancy is the weakest type of relationship and doesn't really indicate a concrete relationship of a given type.
I hope that helps.
Larry
- Marked As Answer byEdwer FangMSFT, ModeratorTuesday, November 03, 2009 3:31 AM


