Builder Pattern - Stop Writing Huge Constructors | 6/25
Builder Pattern - stop writing constructors with 12 parameters. This is the cleanest way to construct complex objects step by step.
Builder Pattern - stop writing constructors with 12 parameters. This is the cleanest way to construct complex objects step by step.
What’s in the video (5m 4s)
- 0:00 — Builder Pattern
- 0:45 — Simpler Factory Pattern vs Builder Pattern
- 1:22 — What is Telescoping Constructor?
- 2:33 — How Builder Pattern Works?
- 3:26 — When to Use Builder Pattern?
- 4:01 — When to Avoid Builder Pattern?
Resources
- Full Design Patterns series: YouTube playlist
- Previous episode: https://youtu.be/FVD9_CtcwdI
- Next episode: https://youtu.be/m2-Hhw5jgA0
- Source notes / code: https://github.com/learnwithmanoj/design-patterns-simplified/blob/main/06-creational-builder.md
For more in this series, visit the #design-patterns tag page or jump to the channel uploads list for everything else.
Related posts
Singleton Pattern Explained - Anti-Pattern or Essential? | 8/25
Singleton Pattern - the most controversial design pattern in software. Half the developers call it an anti-pattern, the other half use it every day. So who's right?
Prototype Pattern - Clone Objects Instead of Rebuilding | 7/25
Prototype Pattern - when creating an object from scratch is expensive, clone an existing one instead. This is also where shallow-copy vs deep-copy bugs come from.
Abstract Factory Pattern - The 'Factory of Factories' Explained | 5/25
Abstract Factory Pattern explained with the matching-showroom analogy - the creational pattern for when you need to produce entire families of related objects together.