Architecture Patterns with Python

Architecture Patterns with Python

Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices

Harry Percival, Bob Gregory

Repository Pattern Recap Apply dependency inversion to your ORM Our domain model should be free of infrastructure concerns, so your ORM should import your model, and not the other way around. The Repository pattern is a simple abstraction around permanent storage The repository gives you the illusion of a collection of in-memory objects. It makes it easy to create a FakeRepository for testing and to swap fundamental details of your infrastructure without disrupting your core application.
1262