The Modern .NET Show cover image

Clean Architecure with Matthew Jeorrett

The Modern .NET Show

CHAPTER

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,.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner