Why I’m Finally Letting Go of the Repository Pattern
Original post Why I’m Finally Letting Go of the Repository Pattern (Yes, I was a fan once upon a time.) What it promised: 🔹 A clean boundary between domain logic and the data model/db 🔹 Easier maintainability by hiding data access details 🔹 Flexible architecture: swap out the ORM or DB anytime 🔹 Horizontal layering: controllers → services → repositories → DB What I experienced instead: 🔹 Mapping overhead everywhere: data model, domain model, DTOs, etc. 🔹 Rigid layering: feature logic split across too many folders and files 🔹 Orchestration fatigue: most ORMs (EF, Dapper) already solve common data issues 🔹 Slowed delivery: multiple abstractions for minimal real-world benefit When it clicked: Realizing typical line-of-business apps don’t need all this ceremony. Focusing on data flow (request → handler → data model/events → response) cuts out layers that don’t add value. Where I’m heading: ✅ Feature slices: group logic, data, and business rules together ✅ Less friction: directly l...