
Full-Stack React, TypeScript, and Node
By :

In this section, we'll learn about the importance of using a repository layer. Having a separate layer for a large and important part of our application can help make code refactoring easier. It is also helpful in terms of understanding how the app works since major sections are logically separated out.
In Chapter 1, Understanding TypeScript, we learned about Object-Oriented Programming (OOP). One of the major mechanisms for implementing OOP design is the use of abstraction. By creating our database access code in its own separate layer, we are using abstraction. As you may recall, one of the benefits of abstraction is that it hides the implementation of the code internally and exposes an interface to outside callers. Additionally, because all code related to accessing the database is in one place, we don't have to hunt around to find our database query code. We know which layer of our application this code lives...