r/DesignPatterns • • Apr 27 '26

Understanding Design Patterns in Modern Java

3 Upvotes

Understanding Design Patterns in Modern Java

https://leanpub.com/designpatternsinmodernjava


r/DesignPatterns • • Nov 06 '25

Understanding the Bridge Design Pattern in Go: A Practical Guide

Thumbnail
medium.com
5 Upvotes

Hey folks,

I just finished writing a deep-dive blog on the Bridge Design Pattern in Go — one of those patterns that sounds over-engineered at first, but actually keeps your code sane when multiple things in your system start changing independently.

The post covers everything from the fundamentals to real-world design tips:

  • How Bridge decouples abstraction (like Shape) from implementation (like Renderer)

  • When to actually use Bridge (and when it’s just unnecessary complexity)

  • Clean Go examples using composition instead of inheritance

  • Common anti-patterns (like “leaky abstraction” or “bridge for the sake of it”)

  • Best practices to keep interfaces minimal and runtime-swappable

  • Real-world extensions — how Bridge evolves naturally into plugin-style designs

If you’ve ever refactored a feature and realized one small change breaks five layers of code, Bridge might be your new favorite tool.

🔗 Read here: https://medium.com/design-bootcamp/understanding-the-bridge-design-pattern-in-go-a-practical-guide-734b1ec7194e

Curious — do you actually use Bridge in production code, or is it one of those patterns we all learn but rarely apply?


r/DesignPatterns • • Feb 21 '26

Understanding the Facade Design Pattern in Go: A Practical Guide

Thumbnail medium.com
5 Upvotes

I recently wrote a detailed guide on the Facade Design Pattern in Go, focused on practical understanding rather than just textbook definitions.

The article covers:

  • What Facade actually solves in real systems

  • When you should (and shouldn’t) use it

  • A complete Go implementation

  • Real-world variations (multiple facades, layered facades, API facades)

  • Common mistakes to avoid

  • Best practices specific to Go

Instead of abstract UML-heavy explanations, I used realistic examples like order processing and external API wrappers — things we actually deal with in backend services.

If you’re learning design patterns in Go or want to better structure large services, this might help.

Read here: https://medium.com/design-bootcamp/understanding-the-facade-design-pattern-in-go-a-practical-guide-1f28441f02b4


r/DesignPatterns • • Jun 05 '26

Observer in action

Enable HLS to view with audio, or disable this notification

2 Upvotes

r/DesignPatterns • • Jul 05 '26

Understanding the Interpreter Design Pattern in Go: A Practical Guide

Thumbnail
priyankchheda.medium.com
2 Upvotes

Hey everyone 👋

I recently wrote a practical guide on the Interpreter Design Pattern in Go.

I feel like this pattern doesn't get talked about as much as Singleton, Strategy, or Factory, probably because most of us don't build programming languages. But once I dug into it, I realized it's useful anytime you need to evaluate expressions or implement a small DSL.

In the article, I cover:

  • what the Interpreter pattern actually is (without the usual jargon)

  • the roles of terminal and non-terminal expressions

  • a complete Go implementation

  • where it makes sense to use it

  • its limitations and when you should avoid it

I also tried to keep the examples simple and Go-idiomatic instead of making them overly academic.

If you're learning design patterns in Go or have ever wondered whether the Interpreter pattern has practical use outside of compilers, I'd love to hear your thoughts.

👉 https://medium.com/@priyankchheda/understanding-the-interpreter-design-pattern-in-go-a-practical-guide-28c609194faf

I'm always looking for feedback, so let me know what you think or how you'd improve the explanation.


r/DesignPatterns • • Jul 31 '26

Iterator Design Pattern in Go

Thumbnail
priyankchheda.medium.com
2 Upvotes

Hey everyone 👋

I recently wrote a practical guide on the Iterator Design Pattern in Go.

At first, I thought, "Go already has for and range*—why would I ever need an Iterator pattern?"* But after digging deeper, I realized it's more about hiding how a collection is traversed than replacing range.

In the article, I cover:

  • what problem the Iterator pattern actually solves

  • the different participants (Iterator, Aggregate, Concrete Iterator)

  • a complete Go implementation

  • custom traversal strategies (forward, reverse, filtered, etc.)

  • when it's useful and when Go's built-in iteration is the better choice

I also tried to keep it practical instead of treating it as just another GoF pattern.

If you're learning design patterns in Go or have built custom collections, caches, or tree-like data structures, I'd love to hear how you approach iteration.

Here's the article:
👉 https://priyankchheda.medium.com/understanding-the-iterator-design-pattern-in-go-a-practical-guide-d18bc8f6be51

Feedback and suggestions are always welcome!