January 2024
Intermediate to advanced
718 pages
20h 15m
English
Our original challenge was to read in data from multiple CSV files and produce various simple reports. So far, all we have is BookInStock, a class that represents the data for one book.
During object-oriented design, you identify external things and make them classes in your code. But there’s another source of classes in your designs—the classes that correspond to things inside your code itself. For example, we know that the program we’re writing will need to consolidate and summarize CSV data feeds. But that’s a passive statement. Let’s turn it into a design by asking ourselves what does the summarizing and consolidating. And the answer (in our case) is a CSV reader. Let’s make it into a class as follows: ...
Read now
Unlock full access