Question of the Week: Design Patterns

January 27, 2025#Software Development
Article
Author image.

Sarah Dutkiewicz, Senior Trainer

Over on Bluesky, we’ve started adding a Question of the Week that comes up during the beginning of the week. I’m picking questions that are related to the things we do here at NimblePros and what we’ve done throughout our careers.

This week’s question is:

📃 What’s your go-to design pattern, and how has it saved the day in a project?

Before you overthink it, know I’ve already done that for you!

If you prefer a video on this, I got you covered on our YouTube channel!

Design Patterns aren’t Golden Hammers

A design pattern is not a “one pattern solves all the problems” solution. A design pattern should not be seen as a Golden Hammer. Design patterns are typically focused for particular scenarios or use cases.

Golden Hammer - Stand back! I have just the tool to solve this.

When learning about the patterns, we’ve seen people jump into using them without considering complexity or trade-offs. We have also seen people trying to be “clever” and overcomplicating their code by writing a Rube Goldberg chain of design patterns. Another problem we see with design patterns is that people may prematurely optimize their code, making it harder to maintain in the long run - for example, using the Decorator pattern when a simple in-memory cache would suffice.

Just because you have a go-to doesn’t make it the only design pattern in your toolbelt!

Not All Design Patterns are in the Gang of Four Book

As technology evolves over time, we’ve been able to identify more patterns that aren’t in the Gang of Four book. For example, some of the patterns you might not see there include:

  • Circuit Breaker Pattern
  • Service Locator Pattern
  • Bulkhead Pattern
  • Event Sourcing Pattern
  • CQRS

What’s Sadukie’s Go-To Design Pattern?

My favorite go-to design pattern is the repository pattern. Why is this my go-to? When it comes to functional code, it’s my go-to because it allows us to keep objects persistence ignorant. If an app is done well, you should be able to run it in your lower environments and production environments with minimal changes. And what happens when you decide to go from SQL Server to Postgres? Or from SQL Server to MongoDB? Maybe you want to use an in-memory storage provider. You should be able to change your infrastructure plumbing in a small spot rather than having to reference persistence platform-specific libraries throughout your code. This is how it has saved the day while working with my clients!

But wait… there’s more!

Design patterns are something I have gotten excited in teaching, especially since there are moments from when I was in school where these things didn’t make sense. They taught the theory and pattern, but there wasn’t a good real world, practical example for many patterns. So I’m here to talk about them and show how to work with them in practical applications!

We have some past webinars on some patterns, and we have an upcoming webinar this April on more patterns! Check them out:

So… what is your go-to design pattern? And how has it saved the day?

Reply to us on Bluesky!

Need to find a design pattern? Check out our collection of design patterns at DevIQ.com.


Copyright © 2025 NimblePros - All Rights Reserved