Abstract the abstraction 🤯.
.NET devs, we love our patterns… maybe too much.
For a simple CRUD app, I’ve seen:
- Repositories – because obviously we can’t query directly, that’s too mainstream
- UnitOfWork – like transactions, but now with extra ceremony
- Services – logic lives here… all of it… dumped in one spot
- DTOs – we copy data from A to B just because we can
- Mediators – when talking to yourself through a message bus feels better
- CQRS – because why read and write in one place when you can have two?
- Specification Pattern – too much for basic queries
- Generic Repositories – one size fits none
- Domain Events – when your CRUD thinks it’s Event-Driven
- Pipeline Behaviors – middleware galore for basic logic
- Decorators everywhere – layering just to log or retry
All stacked into a beautiful, cursed lasagna 🍝 of abstraction. Been there. Did that. I was proud of it too!
Until I realized…I wasn’t building a rocket ship 🚀. I was just over-architecting a to-do list.
Now?
- I embrace KISS
- I chant YAGNI
- I apply Minimal Viable Architecture
The more senior I got, the simpler my code became.
My secret sauce at the moment? Vertical slice architecture.
Yes, I know—another pattern. But this one lets you keep the whole feature in one place. Simple code with no layers unless you really need them.
It keeps me grounded. Keeps me shipping. Keeps me sane.
Remember: Abstraction is a tool, not a religion. Solve the problem. Create the least friction.
How many layers do you really need in your current project?