O'Reilly logo

Microsoft® Visual Studio® 2010 Unleashed by Lars Powers, Mike Snell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

Inheritance

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required