frontend
Staged typed builder
Use a staged builder so required steps must be completed before the final object can be created.
Intent: Enforce construction order and required fields at compile time.
Problem: Optional and required fields are easy to mix up when object creation is too flexible.
Solution: Use staged types to guide the caller through the construction steps in the correct order.
Dependencies
Related variants
Examples
This is the best choice when the final object must never be partially built or invalid.