RTS Questionnaire · Question 32 of 52 · file: answers/q32.html
Have you implemented design patterns such as Repository and Unit of Work?
Design PatternsArchitecture.NET
✅ Yes — Repository and Unit of Work are patterns I have implemented across .NET, Java and Python codebases.
🧪 Interactive proof: this answer has its own page with a live repository & unit-of-work workflow and the same contract implemented in .NET, Java/Spring and Python — open the Q32 Repository & Unit of Work proof →
Technical detail
- 🗄️ Repository — domain-facing interfaces (for example
ICustomerRepository) with infrastructure implementations over EF Core/Dapper, Spring Data/JPA or SQLAlchemy. Query methods express intent (GetActiveByPlanAsync) instead of leaking query objects, and specification-style objects handle complex filtering and projections. - 🧾 Unit of Work — a single transactional boundary per use case: in EF Core the
DbContextacts as the unit of work (change tracking + oneSaveChanges), orchestrated by an application handler or a dedicated UoW abstraction that commits or rolls back the whole operation, including outbox writes when events must be published atomically. - 🔗 Composition with other patterns — CQRS (separate read models/queries from write repositories), specification pattern for reusable predicates, decorators for caching and logging around repositories, and domain events raised inside the transaction then dispatched after commit.
- ⚖️ Pragmatism — I avoid repository-over-repository or fan-out N+1 pitfalls, keep read-heavy reporting on lean query paths (raw SQL/Dapper) instead of forcing everything through the domain model, and I do not abstract away an ORM that is already an abstraction when it adds no value.
🧪 Both patterns are covered by tests: in-memory or SQLite providers for fast unit tests, and containerised databases for integration tests of transaction rollback and concurrency behaviour.
🧾 CV evidence: CV: Repository pattern implementation referenced in the Java/SOA track; Entity Framework and Dependency Injection in the .NET stack; layered architecture with data-access abstraction across enterprise projects; 2025 assessments documenting ports/adapters with repository-style adapters.