Creational Patterns
Patterns focus on flexible and controlled object creation, often using interfaces, functions, and struct composition rather than traditional class-based inheritance.
1. Functional Options
Uses variadic option functions to configure an object.
2. Configuration Struct + Factory
Mimics traditional builders with method chaining.
3. Configurable Object
Allows an object to be created with default values and then configured step-by-step through setter methods.
4. Lazy Initialization
Delays object creation until it’s needed.
5. Fluent Interfaces
Chaining method calls on the same object, often seen in SQL builders or HTTP clients.