Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Source

https://refactoring.guru/design-patterns/builder

Important:

  1. Builder is a creational design pattern that lets you construct complex objects step by step. The pattern allows you to produce different types and representations of an object using the same construction code.
  2. Separates object construction from its representation

Description

Structure

alt tag

How to use

  1. Use the Builder pattern to get rid of a “telescoping constructor”.
  2. Use the Builder pattern when you want your code to be able to create different representations of some product (for example, stone and wooden houses).
  3. Use the Builder to construct Composite trees or other complex objects.

How to implement

https://refactoring.guru/design-patterns/builder#checklist

Running

python main.py
python example.py