The design
The data access layer will consist of three layers. The bottom-most layer, known as the Data Helper Layer, will consist of types that will be used to persist the data. For this example, the data will be stored in an array, but these types should be easily updatable to persist the data any way we need to in the future.
The next layer is the Data Model Layer, which will contain tuples that model how the data is stored in the data helper layer pretty closes. These tuples will be used as temporary storage to read and write data to/from the data store. Some people prefer using structures at the model layer, but I find that tuples work just as well because these types should not contain any business logic.
The final layer is the Bridge ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access