December 2001
Intermediate to advanced
416 pages
8h 16m
English
The primary use of a class is to introduce a new type that more directly represents an entity in our application. In a library checkout application, for example, it is generally easier to program the classes Book, Borrower, and DueDate directly than to translate the program logic to the underlying character, arithmetic, and Boolean data types.
A programming model based on unrelated classes proves cumbersome when an application begins to be filled with class types that represent is-a-kind-of instances of another class type. For example, imagine that over time our library checkout application must add support for a RentalBook class, an AudioBook class, and an InteractiveBook class in addition to the original ...
Read now
Unlock full access