...
This compliant solution entirely avoids the need to modify the object; consequently object invariants cannot be violated and rollback is unnecessary. This approach is preferred over the other compliant solutions, when possible. Note, however, that this approach but may be infeasible for code more complicated than this notional example.
...