SERIES
A practical, hands-on guide to the 23 Gang of Four design patterns for C# developers. Every chapter starts from a real symptom in code, walks through the classical shape, and then shows the modern .NET 10 implementation — records, dependency injection, pattern matching, and the libraries that already do most of the work. Pick one chapter when you have a problem in front of you, or read in order for the full map. Available in English and Vietnamese.
A beginner-friendly tour of design patterns in C# / .NET 10: what they are, when to use them, and how to read the 23 GoF classics without the jargon.
Choose the right design pattern in C# / .NET 10 by matching problem symptoms to intent: a decision tree across all 23 GoF patterns with cross-links.
Wrap-up of Design Patterns A → Z in C# / .NET 10: the five lessons that survive, what to read next, and where each pattern shrinks in modern code.
Use the Singleton pattern in C# / .NET 10 the right way: thread-safe Lazy<T>, why AddSingleton<T> usually replaces it, and when you still need it manually.
Factory Method pattern in C# / .NET 10: when a switch ladder grows out of control, when keyed DI replaces the GoF version, and when you still need both.
Abstract Factory pattern in C# / .NET 10: produce a family of related products that vary together (US vs EU UI kits) and how DI replaces the manual factory.
Builder pattern in C# / .NET 10: when records and with-expressions are enough, when you still need a fluent builder class, and how to design one that scales.
Prototype pattern in C# / .NET 10: clone existing objects via record with, why ICloneable is broken, and when to keep an explicit Clone method anyway.
Adapter pattern in C# / .NET 10: wrap legacy SDK calls in your interfaces — sync-to-async, snake_case to PascalCase, and exception-to-Result conversion.
Bridge pattern in C# / .NET 10: separate an abstraction (notification style) from its implementation (delivery channel) to keep N+M classes instead of N*M.
Composite pattern in C# / .NET 10: a shared interface for leaves and groups so totals, rendering, and validation work the same at every level of a tree.
Decorator pattern in C# / .NET 10: wrap a service with logging, retry, and caching without modifying it, and how Scrutor.Decorate automates the registration.
Facade pattern in C# / .NET 10: collapse six injections into one application service that fans out, without leaking the inner classes back to the caller.
Flyweight pattern in C# / .NET 10: share immutable instances to cut allocations on a hot path, with examples from string interning to product badge caches.
Proxy pattern in C# / .NET 10: lazy-load via EF Core proxies, add authorisation around a service, and recognise gRPC clients as remote proxies.
Chain of Responsibility in C# / .NET 10: build validation pipelines like ASP.NET Core middleware, with handlers that can forward or stop the chain.
Command pattern in C# / .NET 10: encapsulate a request as a record, dispatch it to a handler, and how MediatR is this pattern shipped as a NuGet.
Interpreter pattern in C# / .NET 10: build a tiny DSL for discount rules, when Expression trees beat hand-written interpreters, and when to use neither.
Iterator pattern in C# / .NET 10: how yield return and IEnumerable are this pattern, and when IAsyncEnumerable lets you stream remote data lazily.
Mediator pattern in C# / .NET 10: peers publish to a hub instead of calling each other, with MediatR notifications as the standard implementation.
Memento pattern in C# / .NET 10: capture state into snapshots for undo, transactional rollback, and time-travel debugging using record and with.
Observer pattern in C# / .NET 10: notify subscribers when state changes via event, IObservable, INotifyPropertyChanged, or Channel — pick the right one for the case.
State pattern in C# / .NET 10: model an order's lifecycle as states with allowed transitions, using pattern matching or the Stateless library.
Strategy pattern in C# / .NET 10: when a Func delegate is enough, when an injected interface earns its keep, and how Strategy differs from State and Command.
Template Method pattern in C# / .NET 10: when an abstract base with hook methods is right, when Strategy injection wins, and how to avoid inheritance lock-in.
Visitor pattern in C# / .NET 10: when switch expressions with pattern matching beat the GoF double-dispatch hierarchy, and when classical Visitor still wins.