Disadvantages of using Builder method
- Code complexity increases: The complexity of our code increases, because the builder pattern requires creating multiple new classes.
- Mutability: It requires the builder class to be mutable
- Initialization: Data members of the class are not guaranteed to be initialized.
Builder Method – Python Design Patterns
Builder Method is a Creation Design Pattern which aims to “Separate the construction of a complex object from its representation so that the same construction process can create different representations.” It allows you to construct complex objects step by step. Here using the same construction code, we can produce different types and representations of the object easily.
It is basically designed to provide flexibility to the solutions to various object creation problems in object-oriented programming.
UML Diagram of Builder Design Pattern