Abstract data layer
In this section, we will be implementing an abstract data layer to explore repository interfaces. This type of abstraction can be very useful and is another step closer to the Clean Architecture.
Let's start with the problem: the domain layer is where the logic lies, and the UI is the link between the user and the domain, exposing the features built into that domain. On the other hand, the data layer should be an implementation detail that the domain blindly uses. The data layer contains the code that knows where the data is stored, which should be irrelevant to the domain, but the domain indirectly depends on it.
The solution is to break the tight coupling between the domain and the data persistence implementations by creating an additional layer that is abstract, as shown in the following diagram:
New rule: only interfaces and...