|
|
|
|
|
by ambicapter
1204 days ago
|
|
> In practice, I find it is usually something like 'UnvalidatedCustomerInfo' being parsed into a 'CustomerInfo' object, where you can validate all of the fields at the same time In my experience you usually can't validate them all at the same time. For example, address. You usually don't validate that until after the customer has selected items, and then you find out that some items won't deliver to their area, so whereas you previously had a Valid basket, now it's an Invalid state. |
|
Sometimes just splitting stuff into more types that are appropriate to specific portion of pipeline is a win.