Defining Relationships Between Classes

One of the biggest benefits of the class diagram is that it visually represents the relationships between classes. These relationships are much easier to see in a diagram than through code. The following relationships can be represented:

InheritanceIndicates whether a class inherits from another class

InterfaceIndicates whether a class implements one or more interfaces

AssociationIndicates an association between classes

Let’s look at implementing each of these relationships through an example.


First, let’s look at inheritance with the class designer. Suppose that you have a base class called EmployeeBase. This class represents a generic employee in your system. You then want to create ...

Get Microsoft® Visual Studio® 2010 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.