Factory Pattern

Design Patterns Day 2: Stop Hardcoding Object Creation: Factory Pattern for Real Systems

Stop Hardcoding Object Creation: Factory Pattern for Real Systems In Part 1, we used Strategy to remove if-else from business logic. Now we fix the next problem: who decides which strategy to create—and how? The Problem (Picking Up From Strategy) After introducing Strategy, you often end up here: def get_strategy(method: str) -> PaymentStrategy: if method == "credit_card": return CreditCardPayment() elif method == "paypal": return PayPalPayment() elif method == "upi": return UPIPayment() else: raise ValueError("Unsupported payment method") We removed conditionals from business logic… but moved them into selection/creation. ...

May 5, 2026 · 3 min · Nitin S Kulkarni
Strategy Pattern Illustration

Design Patterns Day 1: Stop Writing Endless if-else: Strategy Pattern for Real Systems

Stop Writing Endless if-else: Strategy Pattern for Real Systems You start simple. A small feature. A couple of conditions. Then it grows. And suddenly, your code looks like this: def process_payment(method, amount): if method == "credit_card": return f"Processing {amount} via Credit Card" elif method == "paypal": return f"Processing {amount} via PayPal" elif method == "upi": return f"Processing {amount} via UPI" elif method == "crypto": return f"Processing {amount} via Crypto" else: raise ValueError("Unsupported payment method") Looks fine… until it doesn’t. The Problem At first glance, this works. ...

May 4, 2026 · 3 min · Nitin S Kulkarni

How Support Engineers Actually Solve Production Issues (L1 → L2 → L3 Deep Dive)

Most engineers think support is about “fixing tickets.” It isn’t. Support engineering is a real-time decision system operating under uncertainty, where engineers continuously observe signals, form hypotheses, test them, and take action. This post walks through the actual end-to-end workflow followed by L1, L2, and L3 support engineers in real production systems — with real thinking patterns, not just steps. The Big Picture (High-Level Flow) Every incident flows through a common lifecycle: ...

April 22, 2026 · 4 min · Nitin S Kulkarni