5min chapter

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

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode