3.2.3 How to Represent a Call to Base in a Sequence Diagram

Let's review the inheritance for the Boss.

Looking at this diagram, we can see that both classes have a TakeBreak method, but the Employee class's is virtual and the Boss class's is override. This means that the Boss class can say "that's great that TakeBreak exists, but I don't like that that does and I want to do my own thing".

Descendant classes can also use the method from the inherited class as an additional call. This is called "calling base". Let's take a closer look at what some of these methods do.


In the Employee class, the TakeBreak method reduces the HoursWorked by the amount passed in. This functionality is available to all classes that inherit from the Employee class.

In the Boss class, there is an override that looks like this:

And for simplicity we can call this from the MainWindow, which will look like this in a sequence diagram:

Note that the call is on the boss object that is of type Boss not of type Employee.

When the application executes it will first look for the method in the descendant class and if it doesn't find it will try and find it in the inherited class. There will be more on that later.

Then we need to represent the call to the GoHomeForLunch method.

We have a problem, though, which is that the boss isn't taking their time out of their hours worked. They want to be a good leader and show they don't take free breaks so they need to call the TakeBreak method from the inherited class. To do this we need to use the base keyword. The keyword base is like this but for inherited classes (more on that later).

This is represented in a sequence diagram as:

Note that the call looks exactly the same as the first call to TakeBreak, but is followed by a [base Employee] notation. This notation signifies the call is a call to base (the inherited class) and then shows the class type of the inherited class. Much like properties in sequence diagrams, we will have you create diagrams using [ ] notation, but instructions will show < > notation.