The Modern .NET Show cover image

Clean Architecure with Matthew Jeorrett

The Modern .NET Show

00:00

The Rule of Threes in Repository Methods

The idea of separating these endpoints into their own handlers with their own DTOs and their own repository method is that you don't have to predict how things are going to be used. You can say, well, at this point in time, I'm writing this endpoint, which needs this exact data. And that's good enough for now. It solves trying to generalize things too early in software is quite a common problem. The rule of threes, I think, is the kind of antidote to that as you say,Well, don't don't combine code before you've used it a third time. Then you might have a really good idea of when there is common behavior,.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app