January 2020
Intermediate to advanced
532 pages
13h 31m
English
Let's say we are building a financial application that keeps track of a user's wealth, which may include various types of asset. The following diagram shows a hierarchy of abstract types and their parent–child relationship. In this design, an Asset may be a Property, an Investment, or just Cash types. A Property can be a House or an Apartment. An Investment could be FixedIncome or Equity. As a convention, in order to indicate that they are abstract types rather than concrete types, we have chosen to italicize their names in the boxes:

To create an abstract type hierarchy, we can use the following code: ...
Read now
Unlock full access