...
/Enforce a Required Build Sequence in a Sign-Up Form
Enforce a Required Build Sequence in a Sign-Up Form
Create a builder that enforces a specific method call sequence—username and password must be set before optional fields or .build().
We'll cover the following...
We'll cover the following...
Problem statement
You’re designing a secure sign-up flow for a backend service. Each sign-up form must include a username and password before proceeding to optional steps, such as email, profile image, or phone number.
You’ve been asked to implement a SignupFormBuilder that enforces this order of construction. Developers must call .withUsername() and .withPassword() first—in any ...