© 2026 Dometrain. All rights reserved.
Learn how to implement the Creational Design Patterns in C#
Creational patterns are fundamental to writing flexible and maintainable C# code, but they’re often taught academically, disconnected from the real-world problems they solve. This course is a practical, hands-on guide that starts with the specific code smells that indicate a pattern is needed. We’ll begin with the Singleton, moving past the naive implementation to cover the realities of multithreaded applications with a Thread-Safe Singleton with Lock, Double-Checked Locking, and the modern Lazy approach before building a reusable Generic Singleton Base Class. From there, you’ll see how to replace brittle switch-statement construction with the Factory Method, exploring its Polymorphic and Static variations and modernizing it with records and pattern matching. We’ll then tackle the problem of Telescoping Constructors using the Builder pattern, starting with a basic implementation and evolving it into a Fluent Builder with validation, the Director Pattern, and an Immutable Builder with Records.
The course continues with the Prototype pattern, addressing Costly Reconstruction by examining the critical differences between a Shallow Clone with ICloneable and a Deep Clone implemented via a Copy Constructor or serialization. You’ll then learn to manage families of related objects using the Abstract Factory, including techniques for Runtime Factory Selection. The real value, however, comes in the final modules where we combine these patterns to solve complex problems. You won’t just learn patterns in isolation; you’ll build a Plugin Loader using a Singleton and Factory, a Query Builder with a Singleton Cache, and an Email Template Customizer combining Prototype and Builder. The course culminates in a final project, a Document Pipeline, which integrates all five patterns to demonstrate how they work together in a larger system.