Aug 9, 2017 · 1 min read
The point is abstracting the persistence layer, think repository pattern. I can implement different types of persistence technology it can be ORM, rdbms, cloud storage, file system etc. I can change the implementation any time, the app won’t care and it won’t be affected by the changes. That’s why using the Repository Pattern makes it much easier to do TDD, you can mock it or stub it very easy.
example: https://gist.github.com/picaso/817399e1206177ef4d80c53a6bf001b2
