The builder should be used when a DDMS record needs to be built up over time, but validation should not occur until the end. The commit() method attempts to finalize the immutable object based on the values gathered.
The builder approach differs from calling the immutable constructor directly because it treats a Builder instance with no values provided as "no component" instead of "a component with missing values". For example, calling a constructor directly with an empty string for a required parameter might throw an InvalidDDMSException, while calling commit() on a Builder without setting any values would just return null.
@author Brian Uri! @since 1.8.0
|
|