A photo is saved on a laptop while its thumbnail job goes to the cloud: file not found. Learn how one factory per family keeps related objects matching, what it costs, and when to skip it.
November 26, 20268 minutes
A diagram editor has to duplicate shapes it only knows as Shape. Learn how Prototype lets each shape copy itself, why a shallow copy of a group shares its children, and when not to copy at all.
November 26, 20269 minutes
Fifty lines of spawn code and one new Wolf() in the middle. Learn how Factory Method lets the parent keep the steps while each subclass picks the class, and how it differs from its look-alikes.
November 25, 20269 minutes
Three services each open a connection pool and the database falls over. Learn what Singleton promises, how to write it correctly, what it costs, and why most code should make one and pass it in.
November 25, 20269 minutes
Thirty, thin, true, false, true, true, true. Learn how the Builder pattern turns unreadable constructors into a readable, validated, immutable object: order step by step, bake once.
November 24, 202614 minutes