September 2017
Intermediate to advanced
432 pages
8h 20m
English

In 1988, Barbara Liskov wrote the following as a way of defining subtypes.
What is wanted here is something like the following substitution property: If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T.1
To understand this idea, which is known as the Liskov Substitution Principle (LSP), let’s look at some examples.
Imagine that we have a class named License, as shown in Figure 9.1. This class has a method named calcFee(), which ...
Read now
Unlock full access