Builder Pattern

noun

say it: “BIL-der PAT-urn” /ˈbɪldər ˈpætərn/

A design pattern that builds an object one named step at a time, then hands it over finished and checked.

What is Builder Pattern?

The Builder pattern builds a complicated object step by step, with readable method calls, instead of one constructor with a dozen parameters.

var pizza = new PizzaBuilder()
    .Size("large")
    .AddTopping("mushrooms")
    .AddTopping("olives")
    .Build();

In a sentence

  • “With the Builder pattern, the phone desk's call says .with_insurance() instead of a true hidden among eight other values.”

Level: Freelancer · More OOP terms at this level

Updated