Topic
Class Design
Separating behavior from state, deciding what may be inherited, and keeping types honest about what they hold.
10 pages
Writing25 September 2026
Intentional Model Design
A model should express required fields, genuine absence, and distinct variants in its type. Python unions and C# records encode those promises, while boundaries check external values.
Writing6 February 2022
Prefer Composition Over Inheritance
Composition keeps a configuration provider's capabilities limited to what its project needs. The refactor uses self-contained settings providers, a shallow base, and restrained reuse.
Writing5 December 2020
Separate State from Behavior? Yes Please!
Separating state from behavior simplifies object-oriented systems: immutable DTOs carry data, while managers compose collaborators and make operations explicit at call sites.
Writing6 October 2019
Dependency Injection? No Thank You!
Dependency injection exposes private collaborators to callers when used for every internal relationship. Keep classes self-contained and let business code choose real variation.
Writing10 September 2019
Factory Pattern: The Enabler of Polymorphism
A Factory selects and constructs a member of a class family from meaningful input, letting clients use the shared contract while the Factory owns recurring implementation choices.
Writing11 August 2019
The Configuration Provider: An Abstraction With Roles and Responsibilities
A Configuration Provider hides the source, returns typed settings, validates required values, and reports useful errors. Composed providers let each system select its settings.
Chapter20 September 2017
Class Design in C#
Internal by default, behavior-only classes against state-only types, the two sanctioned uses of interfaces, and closing concrete descendants.
Chapter20 September 2017
Class Design in Python
Two kinds of class and why that separation holds, no inheritance for extension, and naming conventions for polymorphic types.
Chapter20 September 2017
Type Annotations in Python
Annotations as intent rather than decoration: None used deliberately, dictionaries kept out of method boundaries, and capability types that tell the truth.
Writing10 February 2013
Factory Method Pattern: The Most Beautiful Pattern We Lost
Factory Method lets consumer subclasses choose dependencies through an overridable creation hook. C# member managers and Windows Forms show its two class families, distinguishing it from a Factory.