Implementing our storage layer with R6 classes
Up to this point, our code's complexity was not much more than that shown in the examples for the colors, rectangles, and squares. At this point, the code will be a bit more complex, since we are dealing with more complex abstractions and interactions among them, but we are ready to tackle the challenge with what we know so far.
Communicating available behavior with a database interface
We will start by defining the interface for databases in the Database
class. This class is never intended to be instantiated itself. Its purpose is to simply provide an interface definition that must be respected by specific database implementations, like the CSVFiles
implementation we will develop, and by the Storage
implementation, to communicate with any database. The advantage of defining an interface such as this is that it provides a common language for these objects to talk to each other, and provides a reference for the programmer of what should be done...