Skip to content

Codem-3/CreationalPatterns-BuilderPattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creational Patterns - Builder Pattern

Overview

The Builder Pattern is another important design pattern within the creational patterns group, which focuses on object-creation mechanisms. The primary purpose of the Builder Pattern is to separate the construction of a complex object from its representation, allowing the same construction process to create different representations.

Why Use Builder Pattern?

  1. Complex Object Creation: Facilitates the creation of complex objects with numerous attributes.
  2. Readable and Maintainable Code: Enhances code readability and maintainability by separating object construction from its representation.
  3. Step-by-Step Construction: Provides a clear process for constructing objects step by step.

UML Diagram

Singleton Pattern UML

UML Class Diagram

image

Benefits of Builder Pattern

  1. Flexible Design: Allows different representations of an object to be created using the same construction process.
  2. Isolation of Construction and Representation: Separates the logic for constructing an object from its representation, improving code organization.
  3. Step-by-Step Object Construction: Enables objects to be constructed in a controlled and predictable manner.

Drawbacks of Builder Pattern

  1. Increased Complexity: Can introduce additional complexity with multiple builder classes and methods.
  2. Overhead of Builder Class: The necessity of creating builder classes and methods may result in some overhead.
  3. Potential for Misuse: Without proper understanding, the pattern can be misused, leading to convoluted code.

About

Implementation on Creational Patterns - Build Pattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages