๐Ÿงฉ Design Patterns with .NET / C#
Home Chapters Examples Diagrams Bibliography GitHub โ†—
  1. Home
  2. Creating Objects Under Control
Part 6 3 chapters

Creating Objects Under Control

Factory Method and Abstract Factory under reified generics, Builder displacement by required members and collection expressions, and Singleton as a DI lifetime.

Chapter 15

Factory Method and Abstract Factory

How reified generics change these patterns, with typeof(T), constructor constraints, and type-keyed registries.

Read โ†’
Chapter 16

Builder, required members, and Prototype with with

Why required members and collection expressions often beat a Builder, and Prototype as a one-line with expression.

Read โ†’
Chapter 17

Singleton, Lazy, and DI lifetimes

Singleton as a lifetime registration rather than a class trick, and where Lazy fits.

Read โ†’
โ† Previous part Selecting and Varying Behaviour Next part โ†’ Composing and Adapting Structure
Design Patterns with .NET / C#
Tutorial content: CC BY 4.0. Sample code: Apache 2.0.
Source on GitHub โ†—  ยท  File an issue โ†—