Twenty-odd years of writing line-of-business software in .NET, and this is where I write up the bits worth passing on: the patterns I use every day and what they’re actually called, the performance problems I keep finding in code reviews, and the occasional gotcha that ruined a Friday.
No toy examples. Everything here comes from code that shipped.
Design patterns in real code
Most developers are already using half the Gang of Four catalogue without knowing the names. This series takes the patterns one at a time, each explained with an everyday comparison and a real example out of an application I work on.
- You're Already Using Design Patterns, You Just Don't Know Their Names
- One Screen, Many Searches: Strategy and Keyed DI
- I Called It a Factory Without Knowing If It Was One
- The Sale Doesn't Know About the Integration: The Observer Pattern
- The Base Class That Won't Let You Forget: Template Method
- A Builder That Stores Questions, Not Answers
- The Menu That Hides Itself: The Composite Pattern
- One Endpoint for Everything: The Adapter Pattern
- An Action, and the Question of Whether to Offer It: The Command Pattern
- The Chain That Knows When to Stop: Chain of Responsibility
Merging two systems
Two installations of the same product, a decade of separate development, and a decision to run them as one. What that actually takes, in the order the foreign keys make you do it.
- Two Systems That Drifted Apart: Merging Databases With a Common Ancestor
- Before You Can Migrate, You Have to Build Somewhere to Put It
- Writing SQL as if Both Databases Were One: Synonyms
- Never Compute an Id, Look It Up: Mapping Tables
- The Order Is Not Up to You: Migrating in Dependency Order
- One Flag Between a Rehearsal and the Real Thing
- What Went Wrong Anyway
.NET
The things that are easy to get wrong, explained without the computer science.
- One Endpoint, Many Payload Shapes: Custom Input Formatters in ASP.NET Core
- Lists, LINQ Where and Dictionaries: .NET Performance in Plain English
- Async/Await Does Not Create New Threads
SQL Server
The ones that look right, run clean, and quietly give you the wrong answer.
Building this site
Jekyll and GitHub Pages bits, mostly written up because I’d forget them otherwise.