January 2020
Intermediate to advanced
532 pages
13h 31m
English
When designing reusable software, we often create abstractions as data types and associate behaviors with them. One way to model behaviors is to leverage a type hierarchy. Following the Liskov Substitution Principle, we should be able to substitute a type with a subtype when a function is called.
Let's revisit the abstract type hierarchy of managing personal assets from Chapter 2, Modules, Packages, and Type Concepts:

We can define a function called value for determining the value of any asset. Such a function can be applied to all the types in the Asset hierarchy if we assume that all the ...
Read now
Unlock full access