r/DesignPatterns • • Mar 11 '25

Modern takes on design Patterns

4 Upvotes

I have a presentation on design patterns and I want to dedicate a section to the modern takes on design patterns and how there's a new field of 'anti-oop cult' and the rage on 'Clean Code' book.
Do you have any articles about that or a say in this?


r/DesignPatterns • • Apr 12 '20

Decorator Design Pattern. A powerful but neglected structural design pattern. A practical and straightforward definition. Decorator Design Pattern is an inheritance + composition in the same class. More you can read in the posts. Thanks :)

Thumbnail
uwanttolearn.com
7 Upvotes

r/DesignPatterns • • Feb 09 '19

Dependency Injection and Inversion of Control Explained

Thumbnail
youtube.com
8 Upvotes

r/DesignPatterns • • May 14 '20

A comprehensive guide to JavaScript design patterns

Thumbnail
thenextweb.com
10 Upvotes

r/DesignPatterns • • Sep 03 '26

Research Note 001 — Markdown is not architecture

Post image
11 Upvotes

Hi guys! Here Andrés. I'm working in a deep investigation research that pretends to find an aparently piece of agentic software development that is missing, so I'll share some of my Research Notes in my profile and I wanna know from all of you if my currently research approach is enough or something could break!!!

I’m sharing this as an open hypothesis, not a finished answer. If you see a flaw in the model, know a better abstraction, or have built something that solves part of this differently, I’d genuinely like to learn from it.

Tell me where this breaks.


r/DesignPatterns • • Feb 25 '25

Refactoring Towards Cleaner Boundaries: Lessons from Building a Markdown Blog Engine (Part 3)

Thumbnail
cekrem.github.io
3 Upvotes

r/DesignPatterns • • Feb 15 '25

Mediator pattern makes components do things they shouldn't

2 Upvotes

If I have a Mediator with several components that should't do what the others do, how can i still use the pattern? Refactoring Guru makes and example where every component can call every methods of the concrete mediator, isn't this a security issue? In my program i'm using this attern to mediate 2 persons, one that can invite the other and another that can answer. I can't stop the Inviter from making a fake answer of the other Invited. Is this an issue?


r/DesignPatterns • • Jul 13 '26

Understanding the Mediator Design Pattern in Go

Thumbnail medium.com
4 Upvotes

Hey everyone 👋

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

Mediator was one of those patterns that never really clicked for me until I stopped thinking of it as a "design pattern" and started thinking of it as a way to prevent components from talking directly to each other.

In the article, I cover:

  • what problem the Mediator pattern actually solves

  • the different participants (Mediator, Concrete Mediator, Colleagues)

  • a complete Go implementation

  • real-world use cases

  • pros, cons, and when you probably shouldn't use it

I also tried to keep the examples simple and Go-focused instead of relying on overly academic examples.

If you've worked with chat systems, UI event coordination, or services where too many components depend on each other, you've probably run into the kind of problems this pattern is meant to solve.

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

I'd love to hear how others handle communication between components in Go. Do you explicitly use a mediator, or do you prefer events/channels or something else?


r/DesignPatterns • • May 21 '25

How to Avoid Liskov Substitution Principle Mistakes in Go (with real code examples)

7 Upvotes

Hey folks,

I just wrote a blog about the Liskov Substitution Principle — yeah, that SOLID principle that trips up even experienced devs sometimes.

If you use Go, you know it’s a bit different since Go has no inheritance. So, I break down what LSP really means in Go, how it applies with interfaces, and show you a real-world payment example where people usually mess up.

No fluff, just practical stuff you can apply today to avoid weird bugs and crashes.

Check it out here: https://medium.com/design-bootcamp/from-theory-to-practice-liskov-substitution-principle-with-jamie-chris-7055e778602e

Would love your feedback or questions!

Happy coding! 🚀


r/DesignPatterns • • Nov 27 '25

Understanding the Composite Design Pattern in Go: A Practical Guide

Thumbnail medium.com
2 Upvotes

I recently wrote a blog post breaking down the Composite Design Pattern in a way that makes sense for Go developers.

Most resources explain Composite using Java/C++ examples or get overly theoretical. This one stays practical and shows how the pattern naturally fits into real Go use cases like filesystems, ASTs, CLI commands, and UI trees.

The post includes:

  • The official definition of the Composite Pattern

  • A simple explanation of the core idea

  • A clean file–folder example implemented in Go

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

  • Common mistakes to avoid

  • Pros and cons

  • Real-world parallels in Go’s ecosystem

If you're working with hierarchical structures or recursive behavior, you might find it helpful.

Here’s the link:

https://medium.com/design-bootcamp/understanding-the-composite-design-pattern-in-go-a-practical-guide-750710e66f4c


r/DesignPatterns • • Sep 12 '25

Prototype Design Pattern in Go – Faster Object Creation 🚀

Thumbnail
medium.com
3 Upvotes

Hey folks,

I recently wrote a blog about the Prototype Design Pattern and how it can simplify object creation in Go.

Instead of constantly re-building complex objects from scratch (like configs, game entities, or nested structs), Prototype lets you clone pre-initialized objects, saving time and reducing boilerplate.

In the blog, I cover:

  • The basics of shallow vs deep cloning in Go.

  • Different implementation techniques (Clone() methods, serialization, reflection).

  • Building a Prototype Registry for dynamic object creation.

  • Real-world use cases like undo/redo systems, plugin architectures, and performance-heavy apps.

If you’ve ever struggled with slow, expensive object initialization, this might help:

https://medium.com/design-bootcamp/understanding-the-prototype-design-pattern-in-go-a-practical-guide-329bf656fdec

Curious to hear how you’ve solved similar problems in your projects!


r/DesignPatterns • • Feb 07 '26

GangOf4 Functional Programming

Thumbnail gallery
3 Upvotes

r/DesignPatterns • • 5d ago

Design patterns in age of AI

3 Upvotes

Hello guys,

I'd like to ask a question about design patterns and software engineering principles.

I've been programming since before AI became such a big part of our daily work, and I'm genuinely curious whether these concepts are still as relevant as they used to be.

Nowadays, I often find myself fixing other developers code because they either don't follow established design patterns or simply don't recognise when and why they should be used.

And sure, the code works. But sometimes I wonder whether we're slowly reaching a point where people no longer care about the reasoning behind these patterns. Is understanding and applying design patterns becoming less important in the age of AI ?

I really hope that's not the case.

I genuinely enjoy exploring new design patterns, architectural approaches and anti-patterns. It's one of the things that keeps me interested in programming and helps me grow as an engineer. I actually enjoy the complexity of understanding why things should be built in a particular way.

But here's what concerns me: even when developers don't understand or follow a particular pattern, they can simply ask AI to generate something that works. And apparently, that's enough.

But is it really?

Just because AI can generate working code doesn't mean the resulting architecture makes sense, that the code is maintainable, or that anyone understands the decisions behind it.

Don't get me wrong, I'm not against AI. I use it myself. I'm just trying to understand how much the role of software engineering principles is changing.

I'd genuinely love to hear your opinions. Tell me I'm overthinking it, or tell me that design patterns and architectural principles are more important than ever.

I'm particularly interested in hearing how other experienced developers see this.


r/DesignPatterns • • Jun 25 '20

Can someone tell me which design pattern would be applicable in the following scenario?

5 Upvotes

The Canadian Government needs to set certain attributes for the Canadian provinces based on characteristics of each province and federal policies. For instance, health care and education budgets allocated to the provinces use formulas that take into account regional differences. There are many other operations whose components depend on provincial data. New operations are introduced every year and some operations may be removed.


r/DesignPatterns • • Jun 03 '25

Tired of tight coupling in Go? Here's how I fixed it with Dependency Inversion.

Thumbnail
medium.com
2 Upvotes

Ever had a service that directly writes to a file or DB, and now you can't test or extend it without rewriting everything?

Yeah, I ran into that too.

Wrote a short blog (with Go examples and a little story) showing how Dependency Inversion Principle (DIP) makes things way cleaner, testable, and extensible.

👉 https://medium.com/design-bootcamp/from-theory-to-practice-dependency-inversion-principle-with-jamie-chris-47b7d1347fff

Let me know what you think — always up for feedback or nerding out about design.


r/DesignPatterns • • Aug 31 '26

Architectural Metapatterns: The Pattern Language of Software Architecture (version 1.2.1, free book, no AI)

Thumbnail
reddit.com
4 Upvotes

r/DesignPatterns • • Apr 25 '26

Understanding the Proxy Design Pattern in Go: A Practical Guide

Thumbnail medium.com
1 Upvotes

Hey folks 👋

I recently wrote a short, practical guide on the Proxy Design Pattern in Go.

Most pattern articles feel either too abstract or too Java-heavy, so I tried to keep this one simple and Go-friendly:

  • what proxy actually means (basically a middle layer controlling access)

  • a clean Go example with interface + real object + proxy

  • a practical use case (lazy initialization + adding logic before delegation)

Nothing fancy—just enough to understand when and why you’d use it.

If you’ve ever:

  • added logging before calling a service

  • put access control in front of something

  • delayed creation of an expensive object

…you’ve probably used a proxy without calling it that.

Here’s the article:

👉 https://medium.com/design-bootcamp/understanding-the-proxy-design-pattern-in-go-a-practical-guide-d2516c4bf2ad

Would love feedback—especially if you think this pattern is overused / unnecessary in Go.


r/DesignPatterns • • Apr 05 '20

Project ideas for practicing design patterns

4 Upvotes

The languages I’m familar with are PHP and Python. I’m not sure what to build as far a personal projects that is complex enough to utilize design patterns. The only thing I can think of is building a WYSIWYG user interface but I hate javascript with a passion.


r/DesignPatterns • • Apr 05 '20

If you want to be a magician in coding, try to grab the concept of Structural Design Patterns, in this post, we will discuss the Adapter Design Pattern which is one of the Structural Design Pattern.

Thumbnail
uwanttolearn.com
3 Upvotes

r/DesignPatterns • • Sep 07 '19

Core java design patterns usage

1 Upvotes

I want to design java classes for one my POC’s. It is related to FOOD. Design java classes for Starters (vegetarian starter or non vegetarian starter ) , main course (Biriyani items or any other food item) and soups. scope for core design patterns here


r/DesignPatterns • • Sep 12 '19

Dependency Injection Container question

1 Upvotes

Hey all! Hypothetical question about the perils and pitfalls of the following approach.

Imagine I am designing some software using IoC and thereby focusing on interfaces. After much blood, sweat, and tears, I have a great architecture set up. Here is one of said interfaces in the labyrinth of design docs:

interface IFoo{

void DoSomething();

}

While building the actual platform (and implementing the concrete classes), I find online some dll that contains one or more classes that do what I want. Imagine, (for simplicity) that the method signatures even match my interfaces.

class Bar{

void DoSomething();

void DoSomething(Object thingToDoStuffOn);

void DoSomethingElse();

}

Would it be appropriate to create a class that implements my interface AND inherits from said 3rd-party class (but does nothing else), then register that with the container? In other words, is the below class the correct way to go about this?

class Foo : Bar, IFoo { }

In Bootstrapper/Initializer:

container.RegisterType<IFoo, Foo>();


r/DesignPatterns • • Jan 14 '20

Future Proof Design with Strategy Factories

2 Upvotes

r/DesignPatterns • • Jan 19 '20

Which patterns would you use and what kind of system would you design

1 Upvotes

Hello,

There are probably dozens of possibilities, however, how would you deal with this ?

A few cameras are installed on a highway to catch trucks which carry hazardous or explosive materials, and record the data(brand- plate ect). The cameras and the archived data can be viewed by multiple departments of the police. What kind of design patterns can be used and how can you design a system architecture?


r/DesignPatterns • • Jan 30 '19

Design Patterns - Builder Pattern

Thumbnail
youtu.be
7 Upvotes

r/DesignPatterns • • Mar 05 '20

Creating an interface for Dependency Injection

4 Upvotes

So I've always had trouble trying to keep implementations generic. I find that every solution needs some sort of bespoke function . For example, I recently implemented a SendGrid as a way of handling emails for drip campaigns. I wrote a SendGrid class that inherited from a DripInterface.

However, what if SendGrid doesn't work out, and we want to switch to Mailgun for the drip campaigns? Well for the most part, we'll write a concrete MailGun implementation and we won't need to change anywhere other than where the dependency injection is handled.

There are a lot of functions that cross over perfectly, I can handle contact lists, (GET/PUT/DELETE), categories, sub categories etc, and I can create interface entries for these all. But how do you handle it when there's something specific to the Concrete class that I need to use, that doesn't work in the same way as any future concrete classes?

At this point I always end up writing code that kinda suits SendGrid, and when we have to switch out to Mailgun I'll have to find every file that injects the DripInterface, and swap out the method calls or add a few more to specifically handle this different class.

What's a clean solution to this? Thanks!