posts

All Posts

Thoughts on code and poetry.

Bridge Pattern

Sometimes your class hierarchy starts to explode: circles vs squares, vector vs raster, light theme vs dark theme… and suddenly you’re staring at a grid of combinations. The Bridge …

Adapter Pattern

We run into adapters in real life all the time: power‑plug adapters, HDMI–to–USB‑C dongles, language interpreters. Software has the same problem — two sides that need to talk, but …

Proxy Pattern

Any time you click something and it looks like the real object, but behind the scenes there’s access control, caching, logging, or lazy loading happening — that’s the Proxy pattern …

Visitor Pattern

Every time you think “I need to run a bunch of different operations over this object hierarchy, but I really don’t want to keep changing those classes”, you’re in Visitor …

Template Method Pattern

If you’ve ever created a base class with a run() method that calls a series of steps, then let subclasses override only a few of those steps, you’ve already reinvented the Template …

Strategy Pattern

Any time you choose between “pay with card”, “pay with PayPal”, or “pay with bank transfer”, you’re bumping into the idea behind the Strategy pattern. Strategy is a behavioral …

State Pattern

You’ve probably written code where an object’s behavior depends on some status or mode field — and then watched a simple if turn into a giant nested if/else or switch as features …

Observer Pattern

Any time you subscribe to something — a newsletter, a Twitch stream, a weather app — you’re living in the world of the Observer pattern. Observer is a behavioral design pattern …

Memento Pattern

Sometimes you just want to hit undo and pretend the last few minutes never happened — in your editor, not in life (unfortunately). That’s exactly the kind of problem the Memento …

Chain of Responsibility Pattern

The Chain of Responsibility pattern is what you reach for when you want to send a request into a pipeline and let whoever can handle it, handle it. It’s a behavioral pattern that …