← Back to design patterns map
Design Pattern

Builder

Build complex objects step by step with a fluent API.

creational

Visual Diagram

builder.select()
-> from()
-> where()
-> limit()
-> build()

When To Use

  • ->SQL query builders
  • ->HTTP request builders
  • ->Email composers
  • ->Complex configuration objects
Used in: Knex.js, Mongoose query API, request builders
builder.js

Live Editor

Loading...

Output

Run code to see output...

Comments

Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.

Loading comments...